Skip to content

Commit 9b48a4f

Browse files
committed
fix: suppress Codacy semgrep workflow_run checkout warning
Add a yaml.github-actions.security.workflow-run-target-code-checkout nosemgrep marker on the actions/checkout step in publish-pypi.yml. The rule fires on any workflow_run+checkout combination, but the job's if-clause already gates on workflow_run.head_branch == 'main' and workflow_run.event != 'pull_request', so a fork PR head can never reach this checkout. The check is supplemented by pinning the ref to workflow_run.head_sha.
1 parent 831da77 commit 9b48a4f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
runs-on: ubuntu-latest
2424

2525
steps:
26+
# nosemgrep: yaml.github-actions.security.workflow-run-target-code-checkout.workflow-run-target-code-checkout
27+
# The job's `if` already gates on workflow_run.head_branch == 'main'
28+
# and workflow_run.event != 'pull_request', so a fork PR head can
29+
# never reach this checkout. We pin to workflow_run.head_sha to
30+
# publish exactly the commit that passed CI on main.
2631
- name: Checkout the exact commit that passed CI
2732
uses: actions/checkout@v4
2833
with:

0 commit comments

Comments
 (0)