Repository navigation
Add default permissions blocks in workflow files - #401
Merged
Merged
Conversation
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
mjohanse-emr
requested review from
bkeryan,
dixonjoel and
jfriedri-ni
as code owners
October 15, 2026 19:34
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>
Contributor
Contributor
There was a problem hiding this comment.
🟡 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: readas 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.
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
mjohanse-emr
marked this pull request as ready for review
October 15, 2026 20:15
mjohanse-emr
enabled auto-merge (squash)
October 15, 2026 20:16
dixonjoel
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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: writepermissions 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.