pyupio / safety

Safety checks Python dependencies for known security vulnerabilities and suggests the proper remediations for vulnerabilities detected.
https://safetycli.com/product/safety-cli
MIT License
1.66k stars 141 forks source link

safety action version 2.0.0 is broken #417

Closed rbarrois closed 1 year ago

rbarrois commented 1 year ago

Description

We run the pyupio/safety Github Action as described here: https://docs.pyup.io/docs/github-actions-safety#step-3-configure-your-github-workflow-yaml-file-to-run-safety-scans

That action relies on the latest docker version from safety; however, when said version requires new parameters, the related action is not kept up-to-date, and crashes.

What I Did

We defined the action as:

- uses: pyupio/safety@2.0.0
  with:
    api-key: *** 
    scan: file
    requirements: requirements.txt

And got the following error:

/app/entrypoint.sh: line 69: SAFETY_ACTION_CREATE_PR: unbound variable

Suggested fix

I think safety should implement one of the following patterns:

Thanks!

yeisonvargasf commented 1 year ago

Hi @rbarrois, thank you for the detailed report!

You are right; I updated the image with a fix to handle the old versions of the GitHub action.

Run integration tests, ensuring that past versions of the action don't crash;

I implemented regression tests, so we can monitor if new features will break the old versions of the GitHub action.

Communicate with its customers when old versions of its Github Actions are deprecated and should no longer be used;

I communicated this to our internal team.

Provide a clear error message when the Docker container fails on invalid error message (e.g. "Please update to pyupio/safety@2.x.y")

Working on this too, it's in the roadmap.

This issue should be fixed, please let me know if all is good from your side and I'll close this issue. Happy to help!

yeisonvargasf commented 1 year ago

@rbarrois, I'm closing this; feel free to open a new one if you find something still isn't working fine.

Thank you for the issue report!