Skip to content

fix(github-actions): default to repo-scoped installation tokens and mask secrets in logs - #4026

Merged
josephperrott merged 3 commits into
angular:mainfrom
josephperrott:fix/token-scoping-and-secrets
Oct 12, 2026
Merged

josephperrott merged 3 commits into
angular:mainfrom
josephperrott:fix/token-scoping-and-secrets

Conversation

@josephperrott

Copy link
Copy Markdown
Member

Default getAuthTokenFor to repository-scoped installation tokens (with explicit multi-repository scoping for org-level actions), mask minted installation tokens via core.setSecret, and ensure installation tokens are always revoked in finally during release/publish.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the getAuthTokenFor utility to support repository-scoped installation tokens, allowing GitHub Actions to request tokens with restricted access. It updates several actions to utilize these scoping options and introduces automatic token revocation in the release publish action. Additionally, comprehensive unit tests are added for both the token utility and the publish action. Feedback on the changes suggests adhering to the principle of least privilege in the org-file-sync action by scoping the token to specific repositories instead of requesting org-wide access, and validating that the minted token is a non-empty string to prevent downstream authentication failures.

Comment thread github-actions/org-file-sync/lib/main.ts Outdated
Comment thread github-actions/utils.ts
Comment thread github-actions/utils.ts
@josephperrott
josephperrott force-pushed the fix/token-scoping-and-secrets branch from 95e3263 to 89a6ae4 Compare October 12, 2026 09:15
@josephperrott
josephperrott force-pushed the fix/token-scoping-and-secrets branch from 89a6ae4 to 36c27b4 Compare October 12, 2026 10:40
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Oct 12, 2026
@josephperrott
josephperrott force-pushed the fix/token-scoping-and-secrets branch from 36c27b4 to a410562 Compare October 12, 2026 12:18
@josephperrott
josephperrott merged commit 1085d03 into angular:main Oct 12, 2026
17 checks passed
@josephperrott

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants