Skip to content

ci: fix Security Checks by adding .safety-policy.yml#3375

Merged
deacon-mp merged 1 commit into
masterfrom
ci/safety-policy-file
May 18, 2026
Merged

ci: fix Security Checks by adding .safety-policy.yml#3375
deacon-mp merged 1 commit into
masterfrom
ci/safety-policy-file

Conversation

@deacon-mp
Copy link
Copy Markdown
Contributor

Security Checks is failing on master (run 26038577932) with 'Invalid value for --policy-file: Policy file YAML is not valid / No such file or directory: .safety-policy.yml'.

The safety 3.x CLI auto-looks for a .safety-policy.yml in cwd even when --ignore is passed inline. Without the file, safety check errors out before running. This affects every Python minor on the matrix.

Fix: Add an empty .safety-policy.yml at repo root to satisfy the auto-lookup, and pass --policy-file explicitly in [testenv:safety]. The existing 39642 / 39659 ignores stay on the CLI so they remain visible in workflow output.

Test: Local 'python3 -m tox -e safety' no longer errors at the policy-file check (it gets past that step and then fails on a downstream network call, which works on GHA runners).

Followup (separate PR): 'safety check' is deprecated as of 2024-06 in favor of 'safety scan'.

safety 3.x CLI auto-looks for a .safety-policy.yml in cwd even when
ignores are passed inline. Without the file, `safety check` errors with
"Invalid value for '--policy-file': Policy file YAML is not valid /
No such file or directory: '.safety-policy.yml'".

Add an empty policy file and pass --policy-file explicitly to keep
CI runs deterministic. The existing 39642 / 39659 ignores stay on the
CLI so they remain visible in workflow output.

This unblocks the Security Checks workflow on master.
@sonarqubecloud
Copy link
Copy Markdown

@deacon-mp deacon-mp merged commit c12162e into master May 18, 2026
15 checks passed
@deacon-mp deacon-mp deleted the ci/safety-policy-file branch May 18, 2026 14:16
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.

1 participant