fix: add explicit GITHUB_TOKEN permissions to workflows#74
Merged
Conversation
Lock down GITHUB_TOKEN to minimum required permissions per job, following principle of least privilege (CodeQL alerts #1, #2, #3). ci.yml: contents: read, pull-requests: write preview.yml: deploy_preview: contents: read + pull-requests: write close_preview: pull-requests: write only (no checkout) deploy.yml already had explicit permissions and is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-74.eastus2.2.azurestaticapps.net |
When a PR only changes non-code files (e.g. workflow YAML), nx affected runs no tests so no coverage XML is produced and code-coverage-results.md is never created. The sticky-pull-request-comment step then fails with 'Either message or path input is required'. - Add continue-on-error to CodeCoverageSummary (graceful no-op) - Add a Check step that sets coverage.outputs.exists - Gate annotate, summary, and comment steps on that output Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-74.eastus2.2.azurestaticapps.net |
chrisjwalk
approved these changes
Mar 16, 2026
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.
Closes #73
Locks down
GITHUB_TOKENto the minimum required permissions per job (CodeQL alerts #1, #2, #3).ci.ymlcicontents: read,pull-requests: writepreview.ymldeploy_previewcontents: read,pull-requests: writepreview.ymlclose_previewpull-requests: writedeploy.ymldeploypull-requests: writeis needed for the sticky coverage comment in CI and for the Azure SWA action posting the preview URL on PRs.