fix: align github.ref to GitHub Action (#1362)
* fix: align github.ref to GitHub Action The `github.ref` value should be `refs/heads/branch` in most cases. There are a few exceptions handled by the code. This change prefixes the default case with `refs/heads` and adds tests for this and the excpetional cases. * fix: correct existing assertions
This commit is contained in:
@@ -486,7 +486,7 @@ func (rc *RunContext) getGithubContext(ctx context.Context) *model.GithubContext
|
||||
}
|
||||
}
|
||||
|
||||
if ghc.EventName == "pull_request" {
|
||||
if ghc.EventName == "pull_request" || ghc.EventName == "pull_request_target" {
|
||||
ghc.BaseRef = asString(nestedMapLookup(ghc.Event, "pull_request", "base", "ref"))
|
||||
ghc.HeadRef = asString(nestedMapLookup(ghc.Event, "pull_request", "head", "ref"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user