Repository navigation
MOBILE-0000: Use a GitHub App token instead of the PAT in release flows - #233
Merged
Merged
Conversation
Release PRs and the master-to-develop merge-back were opened and merged with PAT_FOR_TRIGGERING_BRANCH_PROTECTION, a personal token of an org admin account, only because events made with GITHUB_TOKEN start no workflows. An installation token of the mindbox-mobile-ci App starts them the same way, covers only this repository and the permissions of its step, and expires within an hour. The key comes from the org secret MOBILE_CI_APP_PRIVATE_KEY and the client ID from the org variable MOBILE_CI_APP_CLIENT_ID. Release and merge-back PRs are now authored by mindbox-mobile-ci[bot].
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the switch from PAT authentication to job-scoped GitHub App tokens.
No open issues 🎉
What changed in this PR
Replaces PAT authentication in release PR and master-to-develop merge-back flows with per-job installation tokens for the mindbox-mobile-ci GitHub App.
Changes:
- Creates App tokens with permissions scoped to each job’s needs.
- Uses App tokens for GitHub CLI PR operations.
- Passes the App private key through the reusable publishing workflow’s callers.
| File | Description |
|---|---|
.github/workflows/publish-reusable.yml |
Accepts the App private key and uses an App token to create and merge merge-back PRs. |
.github/workflows/publish-common-trigger.yml |
Passes the App private key to both reusable publishing calls. |
.github/workflows/manual-prepare_release_branch.yml |
Creates an App token for opening release PRs. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release PRs and the master → develop merge-back now use an installation token of the mindbox-mobile-ci GitHub App
instead of PAT_FOR_TRIGGERING_BRANCH_PROTECTION. Each job mints its own token for this repository with only the
permissions its step needs; the key and client ID come from the org secret MOBILE_CI_APP_PRIVATE_KEY and the org
variable MOBILE_CI_APP_CLIENT_ID. Release and merge-back PRs will be authored and merged by mindbox-mobile-ci[bot].
The PAT secret stays until a release passes with the App.
The same steps ran in a sandbox: PR checks start without approval, auto-merge completes after the token is revoked,
the bot's merge starts push workflows, and merges that change workflow files need no Workflows permission.