-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(github): refactor ActionLint job to use the official installer
1. Previously we just winged it with a bash script downloading another bash script to unzip the actionlint binaries. 2. From now on we'll use the GitHub action from the marketplace which has a lot of configuration options exposed in a convenient way such as what type of warnings to ignore, what version of actionlint to install, etc. Signed-off-by: Peter Somogyvari <[email protected]>
- Loading branch information
Showing
1 changed file
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,66 @@ on: | |
workflow_call: | ||
|
||
jobs: | ||
actionlint: | ||
Lint_GitHub_Actions: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Download actionlint | ||
id: get_actionlint | ||
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/v1.6.25/scripts/download-actionlint.bash) | ||
shell: bash | ||
- name: Check workflow files | ||
run: ${{ steps.get_actionlint.outputs.executable }} -color | ||
shell: bash | ||
- name: git_clone | ||
uses: actions/[email protected] | ||
|
||
# We need to wipe the root package.json file because the installation of actionlint fails otherwise like this: | ||
# | ||
# npm ERR! code ERESOLVE | ||
# npm ERR! ERESOLVE could not resolve | ||
# npm ERR! | ||
# npm ERR! While resolving: [email protected] | ||
# npm ERR! Found: [email protected] | ||
# npm ERR! node_modules/typescript | ||
# npm ERR! dev typescript@"5.3.3" from the root project | ||
# npm ERR! peerOptional typescript@">=3.7.2" from [email protected] | ||
# npm ERR! node_modules/tap | ||
# npm ERR! dev tap@"16.3.8" from the root project | ||
# npm ERR! 25 more (ts-jest, @hyperledger/cactus-plugin-satp-hermes, ...) | ||
# npm ERR! | ||
# npm ERR! Could not resolve dependency: | ||
# npm ERR! peerOptional typescript@"^3.2.1 || ^4" from [email protected] | ||
# npm ERR! node_modules/react-scripts | ||
# npm ERR! react-scripts@"5.0.1" from @hyperledger/[email protected] | ||
# npm ERR! examples/cactus-example-cbdc-bridging-frontend | ||
# npm ERR! @hyperledger/[email protected] | ||
# npm ERR! node_modules/@hyperledger/cacti-example-cbdc-bridging-frontend | ||
# npm ERR! workspace examples/cactus-example-cbdc-bridging-frontend from the root project | ||
# npm ERR! | ||
# npm ERR! Conflicting peer dependency: [email protected] | ||
# npm ERR! node_modules/typescript | ||
# npm ERR! peerOptional typescript@"^3.2.1 || ^4" from [email protected] | ||
# npm ERR! node_modules/react-scripts | ||
# npm ERR! react-scripts@"5.0.1" from @hyperledger/[email protected] | ||
# npm ERR! examples/cactus-example-cbdc-bridging-frontend | ||
# npm ERR! @hyperledger/[email protected] | ||
# npm ERR! node_modules/@hyperledger/cacti-example-cbdc-bridging-frontend | ||
# npm ERR! workspace examples/cactus-example-cbdc-bridging-frontend from the root project | ||
# npm ERR! | ||
# npm ERR! Fix the upstream dependency conflict, or retry | ||
# npm ERR! this command with --force or --legacy-peer-deps | ||
# npm ERR! to accept an incorrect (and potentially broken) dependency resolution. | ||
- name: wipe_non_yaml_sources | ||
run: rm -rf packages/ examples/ extensions/ package.json | ||
|
||
- name: actionlint | ||
id: actionlint | ||
uses: raven-actions/[email protected] | ||
with: | ||
version: 1.6.27 | ||
cache: true | ||
|
||
- name: actionlint_summary | ||
if: ${{ steps.actionlint.outputs.exit-code != 0 }} # example usage, do echo only when actionlint action failed | ||
run: | | ||
echo "Used actionlint version ${{ steps.actionlint.outputs.version-semver }}" | ||
echo "Used actionlint release ${{ steps.actionlint.outputs.version-tag }}" | ||
echo "actionlint ended with ${{ steps.actionlint.outputs.exit-code }} exit code" | ||
echo "actionlint ended because '${{ steps.actionlint.outputs.exit-message }}'" | ||
echo "actionlint found ${{ steps.actionlint.outputs.total-errors }} errors" | ||
echo "actionlint checked ${{ steps.actionlint.outputs.total-files }} files" | ||
echo "actionlint cache used: ${{ steps.actionlint.outputs.cache-hit }}" | ||
exit ${{ steps.actionlint.outputs.exit-code }} |