mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
Merge pull request 'feat: export runtime token as FORGEJO_TOKEN' (#88) from xtex/act:forgejo-token-env into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/88 Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
This commit is contained in:
commit
84eca8312d
2 changed files with 2 additions and 0 deletions
|
@ -1198,6 +1198,7 @@ func (rc *RunContext) withGithubEnv(ctx context.Context, github *model.GithubCon
|
|||
env["GITHUB_REF_NAME"] = github.RefName
|
||||
env["GITHUB_REF_TYPE"] = github.RefType
|
||||
env["GITHUB_TOKEN"] = github.Token
|
||||
env["FORGEJO_TOKEN"] = github.Token
|
||||
env["GITHUB_JOB"] = github.Job
|
||||
env["GITHUB_REPOSITORY_OWNER"] = github.RepositoryOwner
|
||||
env["GITHUB_RETENTION_DAYS"] = github.RetentionDays
|
||||
|
|
|
@ -394,6 +394,7 @@ func TestGetGitHubContext(t *testing.T) {
|
|||
assert.Equal(t, ghc.RepositoryOwner, owner)
|
||||
assert.Equal(t, ghc.RunnerPerflog, "/dev/null")
|
||||
assert.Equal(t, ghc.Token, rc.Config.Secrets["GITHUB_TOKEN"])
|
||||
assert.Equal(t, ghc.Token, rc.Config.Secrets["FORGEJO_TOKEN"])
|
||||
assert.Equal(t, ghc.Job, "job1")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue