kwanhur commented on pull request #6340: URL: https://github.com/apache/apisix/pull/6340#issuecomment-1048425281
After a trial, using a local action works fine, have a look at [shellcheck action](https://github.com/kwanhur/apisix/commit/9ad59217a7d69d546aff68f789eee1c20fdac94b) and test case: 1. [check all successfully](https://github.com/kwanhur/apisix/runs/5298179823?check_suite_focus=true) 2. [SC2148 check failed](https://github.com/kwanhur/apisix/runs/5298215814?check_suite_focus=true) ```bash In ci/common-test.sh line 1: . .common.sh ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. For more information: https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y... Error: Process completed with exit code 1. ``` Summary, two solutions can do the shellcheck: I prefer solution1, what's your opinion, @spacewander ? 1. solution1: add one job `sc-lint` at `code-lint.yml` with step `run` commands ```bash scversion="latest" wget -O- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv cp -av "shellcheck-${scversion}/shellcheck" /usr/local/bin/ shellcheck --version shellcheck **/*.sh ``` 2. solution2: add one job `sc-lint` at `code-lint.yml` with step `use` a local action ```yaml runs: using: composite steps: - id: shellcheck run: | scversion="${{ inputs.scversion }}" wget -O- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv cp -av "shellcheck-${scversion}/shellcheck" /usr/local/bin/ shellcheck --version shellcheck **/*.sh shell: bash ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
