Phase 1: use GitHub App token in tools test workflows#407
Conversation
Replace the org PAT (secrets.GH_TOKEN) with a per-job GitHub App installation token in the five tools test workflows: tool-tests, packaging-methods-tests, statistic-tests, statistic-schedule, citus-package-all-platforms-test. Each consuming job now mints a token via actions/create-github-app-token@v2 (app-id/private-key from the existing GH_APP_ID/GH_APP_KEY org secrets, owner: citusdata) and exports it to \ as GH_TOKEN (plus GITHUB_TOKEN for the all-platforms test). The top-level env GH_TOKEN entries are removed, since top-level/job env cannot reference the steps context. No script or tools-package changes: an installation token is a drop-in for the PAT. secrets.GH_TOKEN remains defined org-wide for zero-downtime during the staged migration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The mint step failed with '[@octokit/auth-app] appId option is required' because GH_APP_ID resolved empty as a secret reference. GH_APP_ID is an org variable (App IDs are non-sensitive); GH_APP_KEY remains a secret. Use \�ars.GH_APP_ID || secrets.GH_APP_ID\ so the workflow works whether the App ID is stored as a variable or a secret. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Phase 1 status — token migration validated ✅This PR migrates the ValidatedThe App-token flow is green in CI:
Important config finding
app-id: ${{ vars.GH_APP_ID || secrets.GH_APP_ID }}( Known unrelated CI failure (NOT from this change)The remaining red check is a pre-existing failure, independent of this migration:
Recommend fixing that stale assertion separately to keep this PR token-only. |
Follow-up: full accounting of the red checks (all token-independent)Across the 3 edited workflows that ran on this branch, every App-token step is green and the
These same failures occur on |
|
Superseded by #410. The two phase-1 commits on this branch (836fd65, b148bde) are fully contained in #410 (gh-app-token-phase1-tools-on-409), which carries the complete validated stack: phase-1 App-token workflows + the #409 RPM-signing fixes + the dev3 Node24 action bumps + the dev4/dev5 build_packages per-pg filter. The red CI here is a stale 6/17 run that predates those image-retargeting fixes. Closing to avoid a redundant/confusing second token-migration PR; #410 is the review/merge surface and auto-retargets to develop when #409 merges. Branch retained — reopen if convergence planning needs a standalone develop-targeted phase-1 PR. |
Phase 1 of the GH_TOKEN -> GitHub App migration
Migrates the five tools test workflows from the org PAT secrets.GH_TOKEN to a per-job
GitHub App installation token:
tool-tests.ymlpackaging-methods-tests.ymlstatistic-tests.ymlstatistic-schedule.ymlcitus-package-all-platforms-test.ymlWhat changed
Each consuming job now mints a token with
actions/create-github-app-token@v2(using the existingorg secrets
GH_APP_ID/GH_APP_KEY,owner: citusdata) and exports it to\as
GH_TOKEN(plusGITHUB_TOKENfor the all-platforms test). TheGH_TOKENentries areremoved from the top-level
env:blocks, because top-level/jobenvcannot reference thestepscontext.Why this is safe / zero-downtime
toolspackage or script changes, no re-tag.
secrets.GH_TOKENis intentionally left defined org-wide so other (not-yet-migrated) workflowsand build branches keep working during the staged migration.
Validation
First CI run on this PR also validates that
GH_APP_ID/GH_APP_KEYare visible to thetoolsrepo and that token minting works.