Title: Please define actions workflow permissions · Issue #975 · github/codeql-coding-standards · GitHub
Open Graph Title: Please define actions workflow permissions · Issue #975 · github/codeql-coding-standards
X Title: Please define actions workflow permissions · Issue #975 · github/codeql-coding-standards
Description: Workflow permissions improvement There are 16 workflow files that are currently lacking explicit permissions Affected Workflow Files The following workflow files need permissions to be explicitly defined: .github/workflows/code-scanning-...
Open Graph Description: Workflow permissions improvement There are 16 workflow files that are currently lacking explicit permissions Affected Workflow Files The following workflow files need permissions to be explicitly d...
X Description: Workflow permissions improvement There are 16 workflow files that are currently lacking explicit permissions Affected Workflow Files The following workflow files need permissions to be explicitly d...
Opengraph URL: https://github.com/github/codeql-coding-standards/issues/975
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Please define actions workflow permissions","articleBody":"## Workflow permissions improvement\n\nThere are **16 workflow files** that are currently lacking explicit permissions\n\n### Affected Workflow Files\n\nThe following workflow files need permissions to be explicitly defined:\n\n- [`.github/workflows/code-scanning-pack-gen.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/code-scanning-pack-gen.yml)\n- [`.github/workflows/codeql_unit_tests.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/codeql_unit_tests.yml)\n- [`.github/workflows/dispatch-matrix-test-on-comment.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/dispatch-matrix-test-on-comment.yml)\n- [`.github/workflows/dispatch-release-performance-check.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/dispatch-release-performance-check.yml)\n- [`.github/workflows/extra-rule-validation.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/extra-rule-validation.yml)\n- [`.github/workflows/finalize-release.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/finalize-release.yml)\n- [`.github/workflows/generate-html-docs.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/generate-html-docs.yml)\n- [`.github/workflows/standard_library_upgrade_tests.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/standard_library_upgrade_tests.yml)\n- [`.github/workflows/tooling-unit-tests.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/tooling-unit-tests.yml)\n- [`.github/workflows/update-release.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/update-release.yml)\n- [`.github/workflows/upgrade_codeql_dependencies.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/upgrade_codeql_dependencies.yml)\n- [`.github/workflows/validate-package-files.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/validate-package-files.yml)\n- [`.github/workflows/validate-query-formatting.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/validate-query-formatting.yml)\n- [`.github/workflows/validate-query-help.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/validate-query-help.yml)\n- [`.github/workflows/validate-query-test-case-formatting.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/validate-query-test-case-formatting.yml)\n- [`.github/workflows/verify-standard-library-dependencies.yml`](https://github.com/github/codeql-coding-standards/blob/main/.github/workflows/verify-standard-library-dependencies.yml)\n\n### Request\n\nEnsure permissions are explicitly defined. Below are Copilot prompts/instructions if you would like Copilot's assistance with addressing this.\n\n## GitHub Copilot Assignment Prompts and Context\n\n**Task**: Add explicit permissions to GitHub Actions workflow files that are currently missing them.\n\n**Scope**: Update the workflow files listed above to include appropriate `permissions:` blocks.\n\n**Analysis Methodology**:\n1. **Gather Current State**: Check if the workflow has any existing permissions defined\n2. **Inventory Workflow Actions**: \n - Actions performed directly by the workflow\n - API calls made by the workflow\n - External actions included via `uses:` statements\n3. **Determine Required Permissions**: Map each action to its minimum required permissions\n4. **Synthesize Minimal Permissions**: Create permissions block with only necessary permissions\n\n**Requirements**:\n1. Add a `permissions:` block to each workflow file that doesn't have one\n2. Start with `contents: read` as the minimum permission\n3. Add additional permissions only if the workflow actually needs them based on the actions it performs\n4. Place the `permissions:` block at the job level or workflow level as appropriate\n5. Ensure the syntax is correct and follows YAML formatting\n6. Maintain existing content formatting, including indentation and comments\n\n**Files to modify**: See the list of affected workflow files above.\n\n**Acceptance criteria**:\n- [ ] All listed workflow files have explicit permissions defined\n- [ ] Permissions follow the principle of least privilege\n- [ ] YAML syntax is valid\n- [ ] Workflows still function correctly after changes\n\n## Copilot Instructions:\n\nPlease create a pull request that adds appropriate `permissions:` blocks to each of the workflow files listed above. Analyze each workflow to determine the minimum permissions required based on the actions it performs, and add only those necessary permissions.\n","author":{"url":"https://github.com/misfir3","@type":"Person","name":"misfir3"},"datePublished":"2025-11-20T17:17:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/975/codeql-coding-standards/issues/975"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b537f8c0-27b4-1167-f57d-85e09cb0674b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C4C6:A5F3B:4564E64:5DDBCD6:6964DB9F |
| html-safe-nonce | 5d8533435579a357c682e2a4855738adcbd7e05989d54555c632efd10bb82dfb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEM2OkE1RjNCOjQ1NjRFNjQ6NUREQkNENjo2OTY0REI5RiIsInZpc2l0b3JfaWQiOiIyMDU3OTEwOTk0NDEzNjA3ODM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f5dcd0f1d4c92fc4b7a406645a5be5216df847a5e23975b8ed816e6113277456 |
| hovercard-subject-tag | issue:3648272646 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/codeql-coding-standards/975/issue_layout |
| twitter:image | https://opengraph.githubassets.com/62b518ea731e57ae06c8330d31aea14211d04eab71901ffd40341424566b2c6e/github/codeql-coding-standards/issues/975 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/62b518ea731e57ae06c8330d31aea14211d04eab71901ffd40341424566b2c6e/github/codeql-coding-standards/issues/975 |
| og:image:alt | Workflow permissions improvement There are 16 workflow files that are currently lacking explicit permissions Affected Workflow Files The following workflow files need permissions to be explicitly d... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | misfir3 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5838582163a1256e5ebd5086b7e1dc5cea93d82086c9c8b1395fb50f6ddab28d |
| turbo-cache-control | no-preview |
| go-import | github.com/github/codeql-coding-standards git https://github.com/github/codeql-coding-standards.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 513154248 |
| octolytics-dimension-repository_nwo | github/codeql-coding-standards |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 513154248 |
| octolytics-dimension-repository_network_root_nwo | github/codeql-coding-standards |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8f997e7f84bd1db9537ba403fa68be0da3423594 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width