Skip to content

fix: support GH_TOKEN to override GITHUB_TOKEN#307

Merged
andrii-bodnar merged 4 commits intomasterfrom
app_token
Mar 12, 2026
Merged

fix: support GH_TOKEN to override GITHUB_TOKEN#307
andrii-bodnar merged 4 commits intomasterfrom
app_token

Conversation

@andrii-bodnar
Copy link
Member

No description provided.

@iorate
Copy link

iorate commented Mar 12, 2026

Thank you!

I tested the app_token branch and it worked.

Workflow used:

steps:
  - name: Checkout
    uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
    with:
      persist-credentials: false

  - name: Generate token for pull request
    id: generate-token
    uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
    with:
      app-id: ${{ vars.PULL_REQUESTS_APP_ID }}
      private-key: ${{ secrets.PULL_REQUESTS_PRIVATE_KEY }}

  - name: Crowdin
    uses: crowdin/github-action@app_token
    with:
      download_translations: true
      export_only_approved: true
      pull_request_base_branch_name: master
    env:
      GH_TOKEN: ${{ steps.generate-token.outputs.token }}
      CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
      CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

The generated pull request: iorate/ublacklist#743

One caveat: actions/checkout must be called with persist-credentials: false, otherwise the GITHUB_TOKEN cached in .git/config takes precedence over GH_TOKEN. Thank you!

@andrii-bodnar
Copy link
Member Author

@iorate thank you for the confirmation!
I just pushed the documentation update regarding the persist-credentials note.

@andrii-bodnar andrii-bodnar merged commit d649ada into master Mar 12, 2026
3 checks passed
@andrii-bodnar andrii-bodnar deleted the app_token branch March 12, 2026 15:35
@andrii-bodnar
Copy link
Member Author

@iorate available in v2.15.1 (in the latest v2 as well)

@iorate
Copy link

iorate commented Mar 12, 2026

Thank you for the release!

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.

support custom token (PAT/GitHub App) without relying on GITHUB_TOKEN

3 participants