Skip to content

Commit

Permalink
gitea context
Browse files Browse the repository at this point in the history
  • Loading branch information
Zettat123 committed Jan 15, 2025
1 parent 6cde283 commit fc2ec91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion routers/api/actions/runner/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func generateTaskContext(t *actions_model.ActionTask) *structpb.Struct {
log.Error("actions.CreateAuthorizationToken failed: %v", err)
}

gitCtx := actions.GenerateGitContext(t.Job.Run, t.Job)
gitCtx := actions.GenerateGiteaContext(t.Job.Run, t.Job)
gitCtx["token"] = t.Token
gitCtx["gitea_runtime_token"] = giteaRuntimeToken

Expand Down
4 changes: 2 additions & 2 deletions services/actions/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"code.gitea.io/gitea/modules/setting"
)

// GenerateGitContext generate the git context without token and gitea_runtime_token
// GenerateGiteaContext generate the gitea context without token and gitea_runtime_token
// job can be nil when generating context for interpolating workflow-level expressions
func GenerateGitContext(run *actions_model.ActionRun, job *actions_model.ActionRunJob) map[string]any {
func GenerateGiteaContext(run *actions_model.ActionRun, job *actions_model.ActionRunJob) map[string]any {
event := map[string]any{}
_ = json.Unmarshal([]byte(run.EventPayload), &event)

Expand Down

0 comments on commit fc2ec91

Please sign in to comment.