ci: add least-privilege permissions and pin softprops/action-gh-release#49
Open
ackizilkale wants to merge 1 commit intomainfrom
Open
ci: add least-privilege permissions and pin softprops/action-gh-release#49ackizilkale wants to merge 1 commit intomainfrom
ackizilkale wants to merge 1 commit intomainfrom
Conversation
Resolves the 5 open CodeQL alerts on the repository: - Add explicit `permissions:` blocks to all workflow jobs (contents: read for build/test/publish-pypi; contents: write for the GitHub release job that creates releases). - Pin softprops/action-gh-release@v1 to its commit SHA. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub Actions configuration by adding explicit job-level token permissions and pinning the third-party release action to an immutable commit. It fits into the codebase as CI/CD security maintenance for the existing test and release workflows.
Changes:
- Added explicit
permissionsblocks to the test and annotation test jobs. - Added explicit
permissionsblocks to the publish and GitHub release jobs. - Pinned
softprops/action-gh-releasein the release workflow to a full commit SHA.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/run_tests.yml |
Restricts the main test workflow job to contents: read. |
.github/workflows/run_annotation_tests.yml |
Restricts the annotation test workflow job to contents: read. |
.github/workflows/publish.yml |
Restricts publish job permissions, grants release creation write access, and pins the release action to a commit SHA. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 |
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.
Summary
Resolves the 5 open CodeQL alerts on the Security tab:
permissions:blocks to every workflow job.contents: readfor build/test/publish-pypi,contents: writefor thepublish-github-releasejob (it creates a GitHub release).softprops/action-gh-release@v1to its current commit SHAde2c0eb(CWE-829: unpinned non-immutable Action).Files touched:
.github/workflows/publish.yml— alerts [DEVX-375]: Data Ingestion Pipeline #5, Update README.md #6, Bump setuptools from 67.7.2 to 70.0.0 in /.github/workflows #9.github/workflows/run_tests.yml— alert Handling zero values in Clarifai Annotation Json #3.github/workflows/run_annotation_tests.yml— alert VERSION 0.0.2 #4Dependabot (19 alerts) is already fully resolved — nothing left there.
Test plan
Run testsworkflow still passesRun annotation testsworkflow still passespublish-github-releasejob successfully creates a release with the pinned action🤖 Generated with Claude Code