Add global var note (#4956)

Co-authored-by: Robert Kaussow <xoxys@rknet.org>
This commit is contained in:
qwerty287
2025-03-14 15:51:03 +02:00
committed by GitHub
parent e053cd44d9
commit 836cbbcaed

View File

@@ -41,6 +41,10 @@ Directly import Woodpecker's Go packages (`go.woodpecker-ci.org/woodpecker/v3`)
In the `main` function, just call `"go.woodpecker-ci.org/woodpecker/v3/server/forge/addon".Serve` with a `"go.woodpecker-ci.org/woodpecker/v3/server/forge".Forge` as argument.
This will take care of connecting the addon forge to the server.
:::note
It is not possible to access global variables from Woodpecker, for example the server configuration. You must therefore parse the environment variables in your addon. The reason for this is that the addon runs in a completely separate process.
:::
### Example structure
```go