Update to automatically publish to PyPI on release#71
Update to automatically publish to PyPI on release#71jacquelynsmale merged 2 commits intodevelopfrom
Conversation
| call-changelog-check-workflow: | ||
| # Docs: https://github.com/ASFHyP3/actions | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.20.0 | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.21.0 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
To fix this issue, you should explicitly add a permissions key at the root of the workflow file or within the job definition. Since the job refers to a reusable workflow, and unless specific permissions are required by the called workflow (not shown), the best practice is to set the minimal set: contents: read. This ensures the workflow runs with read-only access by default. If the called reusable workflow requires additional write privileges (for example, to issues or pull-requests), you would need to expand this block accordingly, but contents: read is a secure baseline.
Edit the .github/workflows/changelog.yml file, inserting the following block after the name and before the on block:
permissions:
contents: readNo additional methods, imports, or dependencies are required.
| @@ -1,5 +1,8 @@ | ||
| name: Changelog updated? | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: |
| call-labeled-pr-check-workflow: | ||
| # Docs: https://github.com/ASFHyP3/actions | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.20.0 | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.21.0 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
The best fix is to add a permissions block specifying the minimal set of privileges needed for the job.
This should be added to the job definition (under call-labeled-pr-check-workflow:) or at the root of the workflow (covering all jobs).
Since the workflow only uses a reusable workflow and does not perform any write operations itself, the safe minimal starting point is contents: read, unless the called workflow requires broader permissions.
If the reusable workflow needs more, adjust accordingly, but for minimal compliance, start with:
permissions:
contents: readThis block should be indented to match the job level if placed under the job.
| @@ -12,5 +12,7 @@ | ||
|
|
||
| jobs: | ||
| call-labeled-pr-check-workflow: | ||
| permissions: | ||
| contents: read | ||
| # Docs: https://github.com/ASFHyP3/actions | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.21.0 |
No description provided.