Skip to content

Add explicit read-only permissions to all CI workflow files#305

Merged
bigbrett merged 1 commit intomainfrom
yml-permissions
Mar 18, 2026
Merged

Add explicit read-only permissions to all CI workflow files#305
bigbrett merged 1 commit intomainfrom
yml-permissions

Conversation

@jackctj117
Copy link
Contributor

This pull request updates several GitHub Actions workflow files to explicitly set the permissions for workflow runs. The main change is the addition of permissions: contents: read to each workflow, which improves security by restricting the workflow's access to repository contents.

Security and permissions improvements to GitHub Actions workflows:

  • Added permissions: contents: read to the following workflow files to restrict workflow token permissions:
    • .github/workflows/build-and-bench.yml
    • .github/workflows/build-and-run-examples.yml
    • .github/workflows/build-and-test-clientonly.yml
    • .github/workflows/build-and-test-stress.yml
    • .github/workflows/build-and-test-whnvmtool.yml
    • .github/workflows/build-and-test.yml
    • .github/workflows/clang-format-check.yml
    • .github/workflows/code-coverage.yml
    • .github/workflows/static-analysis.yml

Copilot AI review requested due to automatic review settings March 17, 2026 22:08
Copy link
Contributor

Copilot AI left a comment

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 tightens GitHub Actions security by explicitly setting minimal GITHUB_TOKEN permissions (read-only repo contents) across CI workflows.

Changes:

  • Added top-level permissions: contents: read to all listed CI workflows.
  • Standardized workflow token permissions to follow least-privilege defaults.

Reviewed changes

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

Show a summary per file
File Description
.github/workflows/build-and-bench.yml Restricts workflow token to read-only repository contents.
.github/workflows/build-and-run-examples.yml Restricts workflow token to read-only repository contents.
.github/workflows/build-and-test-clientonly.yml Restricts workflow token to read-only repository contents.
.github/workflows/build-and-test-stress.yml Restricts workflow token to read-only repository contents.
.github/workflows/build-and-test-whnvmtool.yml Restricts workflow token to read-only repository contents.
.github/workflows/build-and-test.yml Restricts workflow token to read-only repository contents.
.github/workflows/clang-format-check.yml Restricts workflow token to read-only repository contents.
.github/workflows/code-coverage.yml Restricts workflow token to read-only repository contents.
.github/workflows/static-analysis.yml Restricts workflow token to read-only repository contents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@bigbrett bigbrett merged commit a40a248 into main Mar 18, 2026
55 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.

4 participants