mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 18:24:14 +01:00
Backport #26759 Co-authored-by: Jason Song <i@wolfogre.com>
This commit is contained in:
parent
c3d323fd85
commit
54cc459ea8
1 changed files with 5 additions and 8 deletions
|
@ -53,8 +53,12 @@ func pickTask(ctx context.Context, runner *actions_model.ActionRunner) (*runnerv
|
||||||
|
|
||||||
func getSecretsOfTask(ctx context.Context, task *actions_model.ActionTask) map[string]string {
|
func getSecretsOfTask(ctx context.Context, task *actions_model.ActionTask) map[string]string {
|
||||||
secrets := map[string]string{}
|
secrets := map[string]string{}
|
||||||
|
|
||||||
|
secrets["GITHUB_TOKEN"] = task.Token
|
||||||
|
secrets["GITEA_TOKEN"] = task.Token
|
||||||
|
|
||||||
if task.Job.Run.IsForkPullRequest {
|
if task.Job.Run.IsForkPullRequest {
|
||||||
// ignore secrets for fork pull request
|
// ignore secrets for fork pull request, except GITHUB_TOKEN and GITEA_TOKEN which are automatically generated.
|
||||||
return secrets
|
return secrets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,13 +82,6 @@ func getSecretsOfTask(ctx context.Context, task *actions_model.ActionTask) map[s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := secrets["GITHUB_TOKEN"]; !ok {
|
|
||||||
secrets["GITHUB_TOKEN"] = task.Token
|
|
||||||
}
|
|
||||||
if _, ok := secrets["GITEA_TOKEN"]; !ok {
|
|
||||||
secrets["GITEA_TOKEN"] = task.Token
|
|
||||||
}
|
|
||||||
|
|
||||||
return secrets
|
return secrets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue