mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
Add support for changing the GITHUB_ACTOR (#229)
This adds the `-a` flag when running `act` to change the username of the GITHUB_ACTOR environment variable Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
parent
09c4c76744
commit
b9851b2453
4 changed files with 11 additions and 1 deletions
|
@ -355,13 +355,19 @@ func (rc *RunContext) getGithubContext() *githubContext {
|
|||
Workflow: rc.Run.Workflow.Name,
|
||||
RunID: "1",
|
||||
RunNumber: "1",
|
||||
Actor: "nektos/act",
|
||||
Actor: rc.Config.Actor,
|
||||
EventName: rc.Config.EventName,
|
||||
Token: token,
|
||||
Workspace: "/github/workspace",
|
||||
Action: rc.CurrentStep,
|
||||
}
|
||||
|
||||
// Backwards compatibility for configs that require
|
||||
// a default rather than being run as a cmd
|
||||
if ghc.Actor == "" {
|
||||
ghc.Actor = "nektos/act"
|
||||
}
|
||||
|
||||
repoPath := rc.Config.Workdir
|
||||
repo, err := common.FindGithubRepo(repoPath)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue