Skip to content

Fix workflow token permission alerts - #19

Merged
Liang-Chun Tsai (ltsai-dev) merged 1 commit into
mainfrom
ltsai-microsoft-resolve-code-scanning-alerts
Aug 18, 2026
Merged

Fix workflow token permission alerts#19
Liang-Chun Tsai (ltsai-dev) merged 1 commit into
mainfrom
ltsai-microsoft-resolve-code-scanning-alerts

Conversation

@ltsai-dev

Copy link
Copy Markdown
Contributor

Summary

  • declare explicit top-level read-only token permissions in the code quality workflow
  • declare explicit top-level read-only token permissions in the unit test workflow
  • retain job-level least-privilege declarations

This addresses CodeQL/OpenSSF Scorecard alerts #60 and #61 (TokenPermissionsID).

Alerts #59 (BranchProtectionID) and #77 (CodeReviewID) are repository-policy/history findings and are not dismissed by this code change. The active main ruleset already mitigates their core risks; closure depends on compliant reviewed merges and a subsequent Scorecard scan.

Declare read-only top-level permissions so future jobs cannot inherit broader repository defaults.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

Pull request overview

This PR addresses CodeQL/OpenSSF Scorecard TokenPermissionsID alerts by explicitly setting top-level GITHUB_TOKEN permissions to read-only in the repository’s CI workflows, while keeping existing job-level least-privilege permissions in place.

Changes:

  • Added top-level permissions: contents: read to the unit test workflow.
  • Added top-level permissions: contents: read to the code quality workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/unit-tests.yml Adds explicit top-level read-only token permissions for the unit test workflow.
.github/workflows/code-quality.yml Adds explicit top-level read-only token permissions for the code quality workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ltsai-dev
Liang-Chun Tsai (ltsai-dev) merged commit 126808f into main Aug 18, 2026
7 checks passed
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.

2 participants