GitHub Actions: Fix Shellsheck workflow to only run on changes *.sh
files
#1423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✍️ Description
The Shellcheck GitHub Action workflow is not running. It throws an error in the "Get changed files" step:
See https://github.com/community-scripts/ProxmoxVE/actions/runs/12724031265/job/35469760341
This Pull Request is using the same "Get changes files" logic from another workflow:
ProxmoxVE/.github/workflows/validate-filenames.yml
Lines 36 to 43 in cc40b59
Why this change?
The current way can't work. E.g. in a119a27#diff-549859aac5bcaebdf605d3ffd525377f2b314b5cc6eb4ebad490bd2cc52617a7L21, the action
ludeeus/action-shellcheck
was removed andshellcheck
was executed directly. Butshellcheck
was never installed. This was never caught, as we never entered this step (due to the error above).Right now, we don't use
ludeeus/action-shellcheck
as this repository requires to only run Shellcheck on changed files (due to the amount of warnings). Theludeeus/action-shellcheck
action doesn't support an "only run on those files" input.We mitigate this by using the same code as the
ludeeus/action-shellcheck
action to install shellcheck. Then, we run it ourselves. This is a (temp) workaround until this repo is shellcheck warning free.Additionally we introduce https://github.com/marketplace/actions/changed-files to detect changed-files. The latest change (see b8671b9) on the changed files detection also proved that this doesn't seem to be straightforward.
As Github action is used only in the Github env and not locally, I think it make sense to use an existing codebase that is proven.
tj-actions/changed-files
need to be approved by Repo admins.🛠️ Type of Change
✅ Prerequisites
Testing is / was partially possible.
The github action "" needs to be approved by Repository admins:
📋 Additional Information (optional)