Skip to content

Add default permissions to workflow files - #193

Merged
mjohanse-emr merged 3 commits into
mainfrom
users/mjohanse/workflow_permissions
Oct 15, 2026
Merged

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

Conversation

@mjohanse-emr

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

Copy link
Copy Markdown
Contributor

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.
  • Removes special write permissions passed from PR.yml to CI.yml. These write permissions are not needed.

Why should this Pull Request be merged?

To resolve CodeQL items for this repo.

AB#4105720

What testing has been done?

Most of the workflows are tested as part of the PR checks. 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>

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

PR.yml loses its only explicit permissions declaration, leaving the configuration gap this PR aims to address.

1 open finding
What changed in this PR

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

Changes:

  • Sets read-only contents permissions for CI, checks, tests, and publishing.
  • Disables built-in token permissions for issue synchronization, which uses a separate token.
  • Removes unnecessary write permissions from the PR workflow’s CI call.
File Description
.github/​workflows/​sync_github_issues_to_azdo.yml Disables built-in token permissions and explains why.
.github/​workflows/​run_unit_tests.yml Adds read-only contents permissions.
.github/​workflows/​publish.yml Adds read-only default permissions.
.github/​workflows/​PR.yml Removes CI caller permission overrides.
.github/​workflows/​CI.yml Adds read-only contents permissions.
.github/​workflows/​check_utilities.yml Adds read-only contents permissions.
.github/​workflows/​check_ni_datastore.yml Adds read-only contents permissions.
.github/​workflows/​check_examples.yml Adds read-only contents permissions.
.github/​workflows/​check_docs.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/PR.yml
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@mjohanse-emr
mjohanse-emr marked this pull request as ready for review October 15, 2026 16:24
@mjohanse-emr
mjohanse-emr requested a review from a team as a code owner October 15, 2026 16:24
@mjohanse-emr
mjohanse-emr merged commit 70c8dde into main Oct 15, 2026
32 checks passed
@mjohanse-emr
mjohanse-emr deleted the users/mjohanse/workflow_permissions branch October 15, 2026 16: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