File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 2424 go-version : ' 1.21'
2525
2626 - name : ' Run tests'
27- env :
28- ACTIONS_TOKEN : ' ${{ github.token }}'
2927 run : |-
3028 go test -count=1 -shuffle=on -timeout=10m -race ./...
Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ function ratchet {
213213 system auth, similar to the Docker and gcloud CLIs.
214214
215215- The GitHub resolver defaults to public github.com. Provide an oauth access
216- token with appropriate permissions via the `ACTIONS_TOKEN ` environment
216+ token with appropriate permissions via the `GITHUB_TOKEN ` environment
217217 variable. To use a GitHub Enterprise installation, set the
218218 ` ACTIONS_BASE_URL` and `ACTIONS_UPLOAD_URL` environment variables to point
219219 your instance.
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import (
1414
1515var (
1616 ActionsBaseURL = os .Getenv ("ACTIONS_BASE_URL" )
17- ActionsToken = os .Getenv ("ACTIONS_TOKEN" )
17+ ActionsToken = coalesce ( os .Getenv ("ACTIONS_TOKEN" ), os . Getenv ( "GITHUB_TOKEN" ) )
1818 ActionsUploadURL = os .Getenv ("ACTIONS_UPLOAD_URL" )
1919)
2020
@@ -153,3 +153,12 @@ type GitHubRef struct {
153153 path string
154154 ref string
155155}
156+
157+ func coalesce (s ... string ) string {
158+ for _ , v := range s {
159+ if v != "" {
160+ return v
161+ }
162+ }
163+ return ""
164+ }
You can’t perform that action at this time.
0 commit comments