Skip to content

Use GitHub App token instead of personal access token for data generation#5417

Draft
ludeeus wants to merge 3 commits into
mainfrom
claude/github-app-token-generate-data-4kcwhy
Draft

Use GitHub App token instead of personal access token for data generation#5417
ludeeus wants to merge 3 commits into
mainfrom
claude/github-app-token-generate-data-4kcwhy

Conversation

@ludeeus

@ludeeus ludeeus commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

This change replaces the use of a static personal access token with a dynamically generated GitHub App token for the data generation workflow, improving security and token management.

Key Changes

  • Added a new step to generate a temporary GitHub App token using the actions/create-github-app-token action
  • Updated the data generation step to use the dynamically generated token (${{ steps.token.outputs.token }}) instead of the static secret (${{ secrets.DATA_GENERATOR_TOKEN }})
  • The GitHub App token is created using client ID and private key credentials stored as secrets

Implementation Details

  • The token generation step uses actions/create-github-app-token@v3.2.0 with pinned commit hash for security
  • The generated token is short-lived and scoped to the specific workflow run, reducing the security risk of token exposure
  • This approach follows GitHub's recommended best practices for using GitHub Apps in workflows instead of personal access tokens

https://claude.ai/code/session_01SwnRB6MUSuVd412MHEMpA9

claude added 3 commits July 22, 2026 20:21
Generate a short-lived GitHub App installation token in each category-data
matrix job via actions/create-github-app-token instead of sharing the static
DATA_GENERATOR_TOKEN secret. Because the job is a matrix (one runner per
category), each category now mints its own token and gets its own GitHub API
rate-limit budget.

The token feeds the existing DATA_GENERATOR_TOKEN env var, so no changes to
the generator script are required.

Requires new secrets DATA_GENERATOR_APP_ID and DATA_GENERATOR_APP_PEM.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SwnRB6MUSuVd412MHEMpA9
client-id is the recommended input over the legacy app-id.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SwnRB6MUSuVd412MHEMpA9
Reflects that the secret holds the GitHub App Client ID.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SwnRB6MUSuVd412MHEMpA9
Copilot AI review requested due to automatic review settings July 22, 2026 20:26

Copilot AI 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.

Pull request overview

This PR updates the generate-hacs-data GitHub Actions workflow to stop using a long-lived personal access token and instead generate a short-lived GitHub App installation token at runtime, improving credential security for the data generation process.

Changes:

  • Adds a step using actions/create-github-app-token@v3.2.0 (pinned by commit) to mint a temporary GitHub App token.
  • Switches DATA_GENERATOR_TOKEN from ${{ secrets.DATA_GENERATOR_TOKEN }} to ${{ steps.token.outputs.token }} for the data generation step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants