diff options
author | Owen <62473795+theowenyoung@users.noreply.github.com> | 2020-09-22 23:13:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 23:13:29 +0200 |
commit | 1070c585381980abe8f636af5212457711a51f03 (patch) | |
tree | eb562fc772115aa4d059376cb666f779470332b6 | |
parent | Fix copyDir to normalize file paths in tar archive (#360) (diff) | |
download | forgejo-act-1070c585381980abe8f636af5212457711a51f03.tar.xz forgejo-act-1070c585381980abe8f636af5212457711a51f03.zip |
feat: support custom GITHUB_RUN_ID, GITHUB_RUN_NUMBER (#369)
* feat: add fromJSON support
* feat: support custom runId and runNumber
* chore: manual update
* chore: lint
-rw-r--r-- | .actrc | 1 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | pkg/runner/run_context.go | 13 |
3 files changed, 11 insertions, 5 deletions
@@ -1 +0,0 @@ --P ubuntu-latest=nektos/act-environments-ubuntu:18.04 @@ -15,7 +15,7 @@ build: .PHONY: test test: - $(ACT) + $(ACT) -W examples/workflows --verbose .PHONY: install install: build diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 158d8f6..971765a 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -351,13 +351,20 @@ func (rc *RunContext) getGithubContext() *githubContext { if !ok { token = os.Getenv("GITHUB_TOKEN") } - + runID := rc.Config.Env["GITHUB_RUN_ID"] + if(runID == ""){ + runID = "1" + } + runNumber := rc.Config.Env["GITHUB_RUN_NUMBER"] + if(runNumber == ""){ + runNumber = "1" + } ghc := &githubContext{ Event: make(map[string]interface{}), EventPath: "/github/workflow/event.json", Workflow: rc.Run.Workflow.Name, - RunID: "1", - RunNumber: "1", + RunID: runID, + RunNumber: runNumber, Actor: rc.Config.Actor, EventName: rc.Config.EventName, Token: token, |