diff options
author | xtex <xtexchooser@duck.com> | 2025-01-04 13:01:43 +0100 |
---|---|---|
committer | xtex <xtexchooser@duck.com> | 2025-01-04 13:01:43 +0100 |
commit | a3738b9032436bd694773f11e3e77b36925da763 (patch) | |
tree | 2d25a115e64ce8cbc659c33aa952d720a7c1bccf /pkg | |
parent | Merge pull request 'chore(lint): fix lint errors' (#84) from earl-warren/act:... (diff) | |
download | forgejo-act-a3738b9032436bd694773f11e3e77b36925da763.tar.xz forgejo-act-a3738b9032436bd694773f11e3e77b36925da763.zip |
feat: export runtime token as FORGEJO_TOKEN
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/runner/run_context.go | 1 | ||||
-rw-r--r-- | pkg/runner/run_context_test.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 3597ce6..a833324 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -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 diff --git a/pkg/runner/run_context_test.go b/pkg/runner/run_context_test.go index af0cd4e..b86638f 100644 --- a/pkg/runner/run_context_test.go +++ b/pkg/runner/run_context_test.go @@ -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") } |