-
Notifications
You must be signed in to change notification settings - Fork 2
Update to automatically publish to PyPI on release #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 about 2 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.
-
Copy modified lines R3-R5
| @@ -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 about 2 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.
-
Copy modified lines R15-R16
| @@ -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.