jbergstroem / hadolint-gh-action

A hadolint linter for github actions that provides code annotations (and more)
MIT License
12 stars 5 forks source link

Error when trying to use the action in multiple steps #134

Closed SMoraisAnsys closed 9 months ago

SMoraisAnsys commented 9 months ago

I'm currently using this wonderful action and I'm encountering a minor bug.

To design an action for a group of projects, I wanted to use hadolint-gh-action in two different steps where the first works on directory docker and the second on .devcontainer. However, if one wants to use the action twice, there is an issue because of mkdir ${{ github.action_path }}/bin in the action.yml file. Since it already exists, you end up with the following error mkdir: cannot create directory ‘/home/runner/work/_actions/jbergstroem/hadolint-gh-action/v1/bin’: File exists.

A quick fix would be to use option -p of mkdir to avoid throwing an error is the path exists.

jbergstroem commented 9 months ago

Interesting find! I guess we could just exit early if the binary already exists. I can make that change unless you're keen!

SMoraisDev commented 9 months ago

Interesting find! I guess we could just exit early if the binary already exists. I can make that change unless you're keen!

Thanks for this fast answer ! Isn't https://github.com/jbergstroem/hadolint-gh-action/pull/135 enough to fix this issue ? If there is a need for something else, please let me know !

jbergstroem commented 9 months ago

Interesting find! I guess we could just exit early if the binary already exists. I can make that change unless you're keen!

Thanks for this fast answer ! Isn't #135 enough to fix this issue ? If there is a need for something else, please let me know !

It would definitely fix the issue; just thinking skipping a download shave off some seconds. To be correct it'd have to take version change checks into consideration though.

SMoraisAnsys commented 9 months ago

Interesting find! I guess we could just exit early if the binary already exists. I can make that change unless you're keen!

Thanks for this fast answer ! Isn't #135 enough to fix this issue ? If there is a need for something else, please let me know !

It would definitely fix the issue; just thinking skipping a download shave off some seconds. To be correct it'd have to take version change checks into consideration though.

You're right, I'll update the PR to skip it if needed. Thanks for pointing that out !