summaryrefslogtreecommitdiffstats
path: root/routers/api/actions/runner/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/actions/runner/utils.go')
-rw-r--r--routers/api/actions/runner/utils.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/routers/api/actions/runner/utils.go b/routers/api/actions/runner/utils.go
index 10f92c29f7..77e660026a 100644
--- a/routers/api/actions/runner/utils.go
+++ b/routers/api/actions/runner/utils.go
@@ -98,14 +98,8 @@ func generateTaskContext(t *actions_model.ActionTask) *structpb.Struct {
baseRef = pullPayload.PullRequest.Base.Ref
headRef = pullPayload.PullRequest.Head.Ref
}
- refPrefix, refName := git.SplitRefName(t.Job.Run.Ref)
- refType := ""
- switch refPrefix {
- case git.BranchPrefix:
- refType = "branch"
- case git.TagPrefix:
- refType = "tag"
- }
+ refName := git.RefName(t.Job.Run.Ref)
+ refType := refName.RefGroup()
taskContext, _ := structpb.NewStruct(map[string]interface{}{
// standard contexts, see https://docs.github.com/en/actions/learn-github-actions/contexts#github-context