File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
routers/api/actions/runner Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,12 @@ func pickTask(ctx context.Context, runner *actions_model.ActionRunner) (*runnerv
5353
5454func getSecretsOfTask (ctx context.Context , task * actions_model.ActionTask ) map [string ]string {
5555 secrets := map [string ]string {}
56+
57+ secrets ["GITHUB_TOKEN" ] = task .Token
58+ secrets ["GITEA_TOKEN" ] = task .Token
59+
5660 if task .Job .Run .IsForkPullRequest {
57- // ignore secrets for fork pull request
61+ // ignore secrets for fork pull request, except GITHUB_TOKEN and GITEA_TOKEN which are automatically generated.
5862 return secrets
5963 }
6064
@@ -78,13 +82,6 @@ func getSecretsOfTask(ctx context.Context, task *actions_model.ActionTask) map[s
7882 }
7983 }
8084
81- if _ , ok := secrets ["GITHUB_TOKEN" ]; ! ok {
82- secrets ["GITHUB_TOKEN" ] = task .Token
83- }
84- if _ , ok := secrets ["GITEA_TOKEN" ]; ! ok {
85- secrets ["GITEA_TOKEN" ] = task .Token
86- }
87-
8885 return secrets
8986}
9087
You can’t perform that action at this time.
0 commit comments