Skip to content

Add default permissions blocks in workflow files - #401

Merged
mjohanse-emr merged 5 commits into
mainfrom
users/mjohanse/workflow_permissions
Oct 16, 2026
Merged

mjohanse-emr merged 5 commits into
mainfrom
users/mjohanse/workflow_permissions

Conversation

@mjohanse-emr

@mjohanse-emr mjohanse-emr commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

What does this Pull Request accomplish?

Adds a default permissions block to the top of almost all of our workflow files. This change is being made to resolve CodeQL issues stating that "Workflow does not contain permissions". Here's an example.

Note: The draft release workflow is given content: write permissions since it needs to be able to create a GitHub release and a tag.

Why should this Pull Request be merged?

To resolve CodeQL items for this repo.

AB#4105722

What testing has been done?

Most of the workflows are tested as part of the PR checks. Notice that the test results are still reported as a comment on this PR. The publish workflow is virtually unchanged since it sets permissions in child jobs/steps. The Sync GitHub Issues workflow will be tested after submission by adding a comment to one of the existing github issues.

Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@mjohanse-emr
mjohanse-emr marked this pull request as draft October 15, 2026 19:37
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

  120 files  ±0    120 suites  ±0   3m 30s ⏱️ +4s
  444 tests ±0    432 ✅ ±0   12 💤 ±0  0 ❌ ±0 
4 440 runs  ±0  4 286 ✅ ±0  154 💤 ±0  0 ❌ ±0 

Results for commit 78c7d5b. ± Comparison against base commit 0046149.

♻️ This comment has been updated with latest results.

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.

🟡 Changes recommended

Draft release creation requires write access, but the workflow now grants only read access without a job-level override.

1 open finding
What changed in this PR

Adds explicit default token permissions to GitHub Actions workflows to address CodeQL warnings.

Changes:

  • Sets contents: read as the default in eleven workflows.
  • Disables built-in token permissions for issue synchronization and documents its separate token usage.
File Description
.github/​workflows/​test_package.yml Adds read-only contents permissions.
.github/​workflows/​sync_github_issues_to_azdo.yml Disables built-in token permissions; explains separate token usage.
.github/​workflows/​publish.yml Adds read-only contents defaults.
.github/​workflows/​PR.yml Adds read-only contents defaults.
.github/​workflows/​get_package_names.yml Adds read-only contents permissions.
.github/​workflows/​get_package_info.yml Adds read-only contents permissions.
.github/​workflows/​draft_release.yml Adds read-only contents defaults.
.github/​workflows/​CI.yml Adds read-only contents defaults.
.github/​workflows/​check_package.yml Adds read-only contents permissions.
.github/​workflows/​check_docs.yml Adds read-only contents permissions.
.github/​workflows/​check_codegen.yml Adds read-only contents permissions.
.github/​workflows/​check_analyzers.yml Adds read-only contents permissions.

🧠 Review effort: Balanced


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

Comment thread .github/workflows/draft_release.yml Outdated
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@mjohanse-emr mjohanse-emr changed the title Users/mjohanse/workflow permissions Add default permissions blocks in workflow files Oct 15, 2026
@mjohanse-emr
mjohanse-emr marked this pull request as ready for review October 15, 2026 20:15
@mjohanse-emr
mjohanse-emr enabled auto-merge (squash) October 15, 2026 20:16
@mjohanse-emr
mjohanse-emr merged commit c39f5cb into main Oct 16, 2026
314 checks passed
@mjohanse-emr
mjohanse-emr deleted the users/mjohanse/workflow_permissions branch October 16, 2026 14:30
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