ossf / scorecard-monitor

Simplify OpenSSF Scorecard tracking in your organization with automated markdown and JSON reports, plus optional GitHub issue alerts
https://github.com/marketplace/actions/openssf-scorecard-monitor
Apache License 2.0
32 stars 13 forks source link

Make the output directories if not exists #49

Closed rajbos closed 1 year ago

rajbos commented 1 year ago

I've bumped into this now three times: when the output directory does not exists (which it will not when the user starts with this), the action just crashes. I think it is a nicer experience to just create the directory for them: they indicate a path already where the files will be written to, so why not just make the dir for them as well? This PR handles that.

UlisesGascon commented 1 year ago

Solved conflicts in e1fec72

rajbos commented 1 year ago

Moved the mkdir code into the utils class. Not sure about the next step: do you want to add unit tests now or later? When now, I do need some help with the setup of overwriting the fs class then.

I'd expect some tests for short/long file paths (multiple layers deep or not) as well as tests for when the folder already exists and when not?

UlisesGascon commented 1 year ago

I can help you with the tests, I will add some commits to the PR :)

UlisesGascon commented 1 year ago

@rajbos I will merge this PR to the branch feat/create-directories and from that branch I will add the tests and create a new PR against main.

See https://github.com/UlisesGascon/openssf-scorecard-monitor/pull/53