Skip to content

ci: add least-privilege permissions and pin softprops/action-gh-release#49

Open
ackizilkale wants to merge 1 commit intomainfrom
fix/codeql-workflow-permissions
Open

ci: add least-privilege permissions and pin softprops/action-gh-release#49
ackizilkale wants to merge 1 commit intomainfrom
fix/codeql-workflow-permissions

Conversation

@ackizilkale
Copy link
Copy Markdown

Summary

Resolves the 5 open CodeQL alerts on the Security tab:

  • Adds explicit permissions: blocks to every workflow job. contents: read for build/test/publish-pypi, contents: write for the publish-github-release job (it creates a GitHub release).
  • Pins softprops/action-gh-release@v1 to its current commit SHA de2c0eb (CWE-829: unpinned non-immutable Action).

Files touched:

Dependabot (19 alerts) is already fully resolved — nothing left there.

Test plan

  • CodeQL re-scan on the PR shows the 5 alerts as fixed
  • Run tests workflow still passes
  • Run annotation tests workflow still passes
  • (On next release tag) the publish-github-release job successfully creates a release with the pinned action

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 5, 2026 22:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 permissions blocks to the test and annotation test jobs.
  • Added explicit permissions blocks to the publish and GitHub release jobs.
  • Pinned softprops/action-gh-release in 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
@ackizilkale ackizilkale requested review from a team and sanjaychelliah May 5, 2026 22:09
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.

2 participants