Switch preview-deploy team check from PAT to GitHub App token#68
Open
nicholasdbrady wants to merge 1 commit into
Open
Switch preview-deploy team check from PAT to GitHub App token#68nicholasdbrady wants to merge 1 commit into
nicholasdbrady wants to merge 1 commit into
Conversation
Microsoft's open-source enterprise policy caps fine-grained PATs at 8 days, which makes the FORGEBOOK_TEAM_READ_TOKEN approach from #67 impractical: it would need manual rotation every week and silently break the workflow on expiry. Replaced it with a minimal GitHub App (org permission: Members, read-only) installed on microsoft-foundry. actions/create-github-app-token mints a fresh 1-hour installation token per run from the app's ID + private key, so there is nothing to rotate. Requires a maintainer to create and install the app, then set the FORGEBOOK_APP_ID and FORGEBOOK_APP_PRIVATE_KEY repo secrets (replacing the now-unused FORGEBOOK_TEAM_READ_TOKEN, which was never actually created). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Why
The
FORGEBOOK_TEAM_READ_TOKENfine-grained PAT from #67 turned out to be impractical: Microsoft's open-source enterprise policy caps fine-grained PATs at 8 days, which would require manually regenerating and updating the secret every week, and the workflow would silently break the moment it expired. That secret was never actually created, so the team-membership check has been failing loudly since #67 merged (as designed, but not sustainable long-term).Approach
Replaced the PAT with a minimal GitHub App:
microsoft-foundryorg.actions/create-github-app-token(official GitHub Action) mints a fresh 1-hour installation token at the start of eachpreview-deploy.ymlrun, from the app's ID and private key. Nothing to rotate, ever.What's needed before this works
Same category of manual, one-time setup as the PAT would have needed, just a different UI flow:
microsoft-foundrywith Members: Read-only org permission (no other permissions, no webhook needed).microsoft-foundryorg.FORGEBOOK_APP_IDandFORGEBOOK_APP_PRIVATE_KEYasforgebookrepo secrets.Once those exist, re-running
Deploy PR Previewon any open fork PR (e.g. #66) will complete the team-membership check without any further rotation.No functional change to the build/cleanup halves of the split from #67 — this only touches how
preview-deploy.ymlauthenticates for the team-membership check.