Skip to content

Commit 63c4c78

Browse files
ci(integration-tests): use github.token for check-run posters
Follow-up to #799. The dispatch failure handlers and auto-pass steps were posting check-runs with `steps.public-token.outputs.token`, which is itself an App-token-generating step. That created a silent-failure trap: if the App secrets are missing or rotated, the App-token step fails, then the failure handler also fails (no token to authenticate with), and the gate sits green from the earlier `skip-integration-tests-pr` job's synthetic-success check — the exact silent-pass anti-pattern the failure handler exists to prevent. Discovered by exercising the dispatch end-to-end on a draft PR before the App secrets were installed (#800 closed). The canonical adbc-drivers/databricks workflow has the same latent bug — fix not yet upstreamed there. The fix is to use the default workflow `${{ github.token }}` for all check-posting steps. The default token already has `checks: write` because each job declares the permission. `steps.public-token` is no longer referenced anywhere; the generation step is removed to keep the workflow tidy. The App token is still used (correctly) for the actual dispatch call into databricks-driver-test, where cross-repo write access is required. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent fb55001 commit 63c4c78

1 file changed

Lines changed: 20 additions & 22 deletions

File tree

.github/workflows/trigger-integration-tests.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,6 @@ jobs:
194194
owner: databricks
195195
repositories: databricks-driver-test
196196

197-
- name: Generate GitHub App Token (public repo)
198-
id: public-token
199-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
200-
with:
201-
app-id: ${{ secrets.INTEGRATION_TEST_APP_ID }}
202-
private-key: ${{ secrets.INTEGRATION_TEST_PRIVATE_KEY }}
203-
owner: databricks
204-
repositories: databricks-sql-python
205-
206197
- name: Sanitize PR title
207198
id: sanitize
208199
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
@@ -235,7 +226,11 @@ jobs:
235226
if: steps.changed.outputs.python != 'true'
236227
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
237228
with:
238-
github-token: ${{ steps.public-token.outputs.token }}
229+
# Default workflow token, not the App token — same rationale
230+
# as the failure handler below. We don't want a missing-secret
231+
# state to silently swallow the green check for path-filtered
232+
# no-op runs.
233+
github-token: ${{ github.token }}
239234
script: |
240235
await github.rest.checks.create({
241236
owner: context.repo.owner,
@@ -255,7 +250,15 @@ jobs:
255250
if: failure() && steps.changed.outputs.python == 'true'
256251
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
257252
with:
258-
github-token: ${{ steps.public-token.outputs.token }}
253+
# Use the default workflow token, not the App token. The
254+
# App-token-generating step is the *most likely* thing to
255+
# fail (missing/rotated secrets, App uninstalled), and using
256+
# it here means a token-generation failure also kills this
257+
# handler — leaving the gate silently green on the stale
258+
# synthetic-success from skip-integration-tests-pr. The
259+
# default token has checks:write (declared on this job)
260+
# which is all we need.
261+
github-token: ${{ github.token }}
259262
script: |
260263
await github.rest.checks.create({
261264
owner: context.repo.owner,
@@ -316,20 +319,13 @@ jobs:
316319
echo "No driver files changed — will auto-pass"
317320
fi
318321
319-
- name: Generate GitHub App Token (public repo)
320-
id: public-token
321-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
322-
with:
323-
app-id: ${{ secrets.INTEGRATION_TEST_APP_ID }}
324-
private-key: ${{ secrets.INTEGRATION_TEST_PRIVATE_KEY }}
325-
owner: databricks
326-
repositories: databricks-sql-python
327-
328322
- name: Auto-pass (no driver changes)
329323
if: steps.changed.outputs.changed != 'true'
330324
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
331325
with:
332-
github-token: ${{ steps.public-token.outputs.token }}
326+
# Default workflow token — see the trigger-tests-pr job's
327+
# equivalent step above for the rationale.
328+
github-token: ${{ github.token }}
333329
script: |
334330
await github.rest.checks.create({
335331
owner: context.repo.owner,
@@ -392,7 +388,9 @@ jobs:
392388
if: failure() && steps.changed.outputs.changed == 'true'
393389
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
394390
with:
395-
github-token: ${{ steps.public-token.outputs.token }}
391+
# Use the default workflow token, not the App token — see
392+
# the rationale in the trigger-tests-pr job above.
393+
github-token: ${{ github.token }}
396394
script: |
397395
await github.rest.checks.create({
398396
owner: context.repo.owner,

0 commit comments

Comments
 (0)