Skip to content

Refactor workflow permissions to remove 'read-all' and standardize to…#201

Merged
frasermolyneux merged 1 commit intomainfrom
feature/workflow-updates
Feb 7, 2026
Merged

Refactor workflow permissions to remove 'read-all' and standardize to…#201
frasermolyneux merged 1 commit intomainfrom
feature/workflow-updates

Conversation

@frasermolyneux
Copy link
Copy Markdown
Owner

This pull request updates several GitHub Actions workflow files to improve security and workflow behavior. The main changes involve tightening workflow permissions by replacing the broad read-all permission with empty or more restrictive permission sets, and adjusting the Dependabot auto-merge strategy.

Workflow permissions hardening:

  • Replaced permissions: read-all with permissions: {} in multiple workflow files to minimize default permissions and adhere to the principle of least privilege. This affects .github/workflows/build-and-test.yml, .github/workflows/codequality.yml, .github/workflows/copilot-setup-steps.yml, .github/workflows/dependabot-automerge.yml, .github/workflows/pr-verify.yml, .github/workflows/release-publish-nuget.yml, and .github/workflows/release-version-and-tag.yml. [1] [2] [3] [4] [5] [6] [7]

  • In .github/workflows/codequality.yml, added id-token: write to the permissions for the secure scanning job, enabling OIDC authentication for improved security in the scanning process.

Dependabot workflow update:

  • Changed the Dependabot auto-merge strategy from a regular merge to a squash merge by updating the gh pr merge command to use --squash instead of --merge, ensuring a cleaner commit history for automated dependency updates.

Copilot AI review requested due to automatic review settings February 7, 2026 11:30
Copy link
Copy Markdown

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

Hardens GitHub Actions security by removing broad default GITHUB_TOKEN permissions at the workflow level and relying on explicit, least-privilege job permissions; also adjusts Dependabot auto-merge behavior.

Changes:

  • Replaced workflow-level permissions: read-all with permissions: {} across all workflows.
  • Added id-token: write to the secure scanning job in codequality.yml to support OIDC.
  • Updated Dependabot auto-merge to use squash merges (gh pr merge --squash).

Reviewed changes

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

Show a summary per file
File Description
.github/workflows/build-and-test.yml Removes broad workflow-level permissions; relies on job-scoped permissions.
.github/workflows/pr-verify.yml Removes broad workflow-level permissions; relies on job-scoped permissions.
.github/workflows/codequality.yml Removes broad workflow-level permissions; adds OIDC (id-token: write) for secure scanning job.
.github/workflows/copilot-setup-steps.yml Removes broad workflow-level permissions; relies on job-scoped permissions.
.github/workflows/dependabot-automerge.yml Removes broad workflow-level permissions; switches Dependabot auto-merge to squash strategy.
.github/workflows/release-version-and-tag.yml Removes broad workflow-level permissions; keeps explicit job-level permissions for tagging.
.github/workflows/release-publish-nuget.yml Removes broad workflow-level permissions; keeps explicit job-level permissions for publishing and releases.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 7, 2026

@frasermolyneux frasermolyneux merged commit 7f418de into main Feb 7, 2026
22 checks passed
@frasermolyneux frasermolyneux deleted the feature/workflow-updates branch February 7, 2026 11:34
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