Skip to content

Use GitHub App token in nightly package build#412

Merged
ihalatci merged 1 commit into
developfrom
ihalatci-migrate-tools-nightly-app-token
Jul 8, 2026
Merged

Use GitHub App token in nightly package build#412
ihalatci merged 1 commit into
developfrom
ihalatci-migrate-tools-nightly-app-token

Conversation

@ihalatci

@ihalatci ihalatci commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Problem

The scheduled Build and publish citus community nightly packages workflow (build-citus-community-nightlies.yml) started failing on all 7 platform matrix jobs at the "Build packages" step (e.g. run 28634135942) with could not determine commit for git ref main.

Root cause: this nightly is the lone unmigrated straggler still consuming the shared org PAT secrets.GH_TOKEN. When citusdata/packaging migrated to a GitHub App token (#1189), the shared org PAT was subsequently retired externally (after 2026-07-02). Inside the citus/packaging container, fetch_and_build_rpm/_deb resolve the citus commit SHA via an authenticated GitHub API call (~/.curlrc injects Authorization: token ${GITHUB_TOKEN}); curl -sf fail-closes on the resulting 401, hiding the error → fast failure across all 7 jobs. Timeline: succeeded 07-02 02:21Z (PAT alive) → fails from 07-03 02:19Z (PAT dead).

Fix

Mirror the packaging #1189 nightly pattern (and the proven-green in-repo precedent citus-package-all-platforms-test.yml):

  1. Delete the dead GH_TOKEN: ${{ secrets.GH_TOKEN }} shadow from the top-level env: block.
  2. Mint a GitHub App token after Checkout, before "Login to Docker Hub", and export both GH_TOKEN and GITHUB_TOKEN to $GITHUB_ENV.

Exporting GITHUB_TOKEN (not just GH_TOKEN) is essential: the failing call is the in-container ~/.curlrc path that consumes GITHUB_TOKEN. The existing --gh_token "${GH_TOKEN}" invocation is left untouched — it now resolves to the freshly minted App token.

Net +13 / −1, single file. Creds confirmed available to citusdata/tools (5 sibling workflows already mint create-github-app-token@v3 with vars.GH_APP_ID / secrets.GH_APP_KEY / owner: citusdata and run green on develop).

Validation

Pushing this branch auto-fires the nightly (push: "**"); publish gates on MAIN_BRANCH="all-citus" ≠ this branch, so publish stays OFF — a build-only validation run.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

The shared org PAT (secrets.GH_TOKEN) was retired after the packaging repo migrated to a GitHub App token, breaking the nightly: the citus/packaging container resolves the citus commit ref via an authenticated GitHub API call that fail-closes on 401.

Mint a GitHub App token with actions/create-github-app-token@v3 and export both GH_TOKEN and GITHUB_TOKEN to the environment (the container's ~/.curlrc consumes GITHUB_TOKEN). Mirrors the proven pattern already green in citus-package-all-platforms-test.yml and packaging PR #1189.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@alperkocatas alperkocatas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good..

@ihalatci ihalatci merged commit e3b01f4 into develop Jul 8, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants