Skip to content

Commit 4d1d7da

Browse files
committed
ci: fall back to GITHUB_TOKEN when REPO_ACCESS_TOKEN unavailable
actions/checkout@v6 (bumped in this PR) errors on empty token input, whereas v4 silently tolerated it. Dependabot PRs run without access to Actions secrets, so secrets.REPO_ACCESS_TOKEN resolves to empty string and every sibling-repo checkout fails with: ##[error]Input required and not supplied: token The InstaNode-dev/{proto,common,api,infra} sibling repos are all public, so GITHUB_TOKEN (scoped to the running repo, read-only on org public siblings) is a valid fallback. Regular PRs continue to use the PAT. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9ad13c9 commit 4d1d7da

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
uses: actions/checkout@v6
107107
with:
108108
repository: ${{ vars.PROTO_REPO || format('{0}/proto', github.repository_owner) }}
109-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
109+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
110110
path: _proto_ci
111111

112112
- name: Place ../proto for Go replace directive
@@ -116,7 +116,7 @@ jobs:
116116
uses: actions/checkout@v6
117117
with:
118118
repository: ${{ vars.COMMON_REPO || format('{0}/common', github.repository_owner) }}
119-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
119+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
120120
path: _common_ci
121121

122122
- name: Place ../common for Go replace directive
@@ -191,7 +191,7 @@ jobs:
191191
uses: actions/checkout@v6
192192
with:
193193
repository: ${{ vars.PROTO_REPO || format('{0}/proto', github.repository_owner) }}
194-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
194+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
195195
path: _proto_ci
196196

197197
- run: mv _proto_ci ../proto
@@ -200,7 +200,7 @@ jobs:
200200
uses: actions/checkout@v6
201201
with:
202202
repository: ${{ vars.COMMON_REPO || format('{0}/common', github.repository_owner) }}
203-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
203+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
204204
path: _common_ci
205205
- run: mv _common_ci ../common
206206

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ jobs:
104104
uses: actions/checkout@v6
105105
with:
106106
repository: ${{ vars.PROTO_REPO || format('{0}/proto', github.repository_owner) }}
107-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
107+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
108108
path: proto
109109

110110
- name: Checkout common sibling (for go.mod replace ../common)
111111
uses: actions/checkout@v6
112112
with:
113113
repository: ${{ vars.COMMON_REPO || format('{0}/common', github.repository_owner) }}
114-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
114+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
115115
path: common
116116

117117
- uses: actions/setup-go@v6

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ jobs:
110110
# is a fine-grained PAT with read access to
111111
# InstaNode-dev/{common,proto}. Set via
112112
# `gh secret set REPO_ACCESS_TOKEN --repo InstaNode-dev/<name>`.
113-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
113+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
114114
path: common
115115

116116
- name: Checkout proto sibling into ./proto
117117
uses: actions/checkout@v6
118118
with:
119119
repository: ${{ vars.PROTO_REPO || format('{0}/proto', github.repository_owner) }}
120-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
120+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
121121
path: proto
122122

123123
- name: Compute build metadata

.github/workflows/integration-backup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
with:
5959
repository: ${{ github.repository_owner }}/infra
6060
path: infra
61-
token: ${{ secrets.REPO_ACCESS_TOKEN }}
61+
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
6262
- name: Install kubectl
6363
uses: azure/setup-kubectl@v5
6464
- name: Set up Go

0 commit comments

Comments
 (0)