Skip to content

Declare least-privilege workflow token permissions - #1652

Open
Ryan Shepherd (DefaultRyan) wants to merge 2 commits into
masterfrom
fix/workflow-token-permissions
Open

Ryan Shepherd (DefaultRyan) wants to merge 2 commits into
masterfrom
fix/workflow-token-permissions

Conversation

@DefaultRyan

Copy link
Copy Markdown
Member

What's this all about?

Declare workflow-level permissions: contents: read in both CI Tests and Check Line Endings. All seven jobs inherit the explicit read-only token permissions, addressing the seven actions/missing-workflow-permissions alerts without granting unnecessary write access.

Checkout requires repository read access; the existing artifact uploads and same-run downloads do not require additional GITHUB_TOKEN permissions. Triggers, jobs, and steps are unchanged.

Validation: git diff --check passed. A Python standard-library comparison against HEAD passed for both workflows, confirming that the permissions block is the only change, there are no job-level overrides, and LF line endings are preserved. Full workflow execution was not run locally. YAML parser validation was unavailable because PyYAML is not installed and installing it was denied.

Fixes: code-scanning alerts 1-7. No associated issue.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No actionable issues were found in the reviewed workflow permission changes.

No open issues 🎉

What changed in this PR

Explicitly limits workflow token permissions to repository read access in CI Tests and Check Line Endings.

Changes:

  • Adds workflow-level permissions: contents: read to both workflows.
  • Leaves triggers, jobs, and steps unchanged.
File Description
.github/​workflows/​ci.yml Sets explicit read-only repository permissions for CI jobs.
.github/​workflows/​check-line-endings.yml Sets explicit read-only repository permissions for line-ending checks.

Review effort: Balanced

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.

3 participants