func getSecretsOfTask(ctx context.Context, task *actions_model.ActionTask) map[string]string {
secrets := map[string]string{}
+
+ secrets["GITHUB_TOKEN"] = task.Token
+ secrets["GITEA_TOKEN"] = task.Token
+
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
}
}
}
- if _, ok := secrets["GITHUB_TOKEN"]; !ok {
- secrets["GITHUB_TOKEN"] = task.Token
- }
- if _, ok := secrets["GITEA_TOKEN"]; !ok {
- secrets["GITEA_TOKEN"] = task.Token
- }
-
return secrets
}