Skip to content

CI: Limit workflow token permissions and checkout credentials - #2057

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
ci/limit-workflow-credentials
Nov 28, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
ci/limit-workflow-credentials

Conversation

@dmitrivMS

Copy link
Copy Markdown
Contributor

The pull request, push, and code-health jobs read source and produce artifacts; they do not push commits. Give these workflows contents: read and disable checkout credential persistence so later builds, tests, and tools do not inherit Git authentication. The Python version check still receives its issue-writing token directly when it needs to report a problem.

The PR label checker lists labels without posting comments. Give it pull-requests: read instead of write access to issues and pull requests. Release, publishing, and localization retain their existing permissions.

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

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

There are no active review issues for the CI permission and checkout-credential hardening changes.

No open issues 🎉

What changed in this PR

Hardens the extension’s CI workflows by limiting token permissions and preventing later build and test steps from inheriting checkout credentials.

Changes:

  • Sets pull request, push, and code-health workflows to contents: read.
  • Disables checkout credential persistence, while preserving the Python version checker’s directly supplied issue-writing token.
  • Reduces the label checker to pull-requests: read; release, publishing, and localization permissions remain unchanged.
File Description
.github/​workflows/​push-check.yml Limits token permissions and disables credentials for source and tools checkouts.
.github/​workflows/​pr-labels.yml Replaces issue and pull request write access with pull request read access.
.github/​workflows/​pr-check.yml Establishes workflow-wide read access and disables checkout credential persistence.
.github/​workflows/​code-analysis.yml Restricts token permissions and disables credentials while retaining full history.
.github/​workflows/​check-python-versions.yml Disables checkout credential persistence without changing the reporting token.

Review effort: Max

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 637fdd1 into main Nov 28, 2026
117 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the ci/limit-workflow-credentials branch November 28, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code quality issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants