diff --git a/.github/workflows/actionlint.yaml b/.github/workflows/actionlint.yaml index b6f2f467f8..5457c8a748 100644 --- a/.github/workflows/actionlint.yaml +++ b/.github/workflows/actionlint.yaml @@ -3,14 +3,66 @@ on: workflow_call: jobs: - actionlint: + Lint_GitHub_Actions: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4.1.1 - - 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/checkout@v4.1.1 + + # 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: react-scripts@5.0.1 + # npm ERR! Found: typescript@5.3.3 + # npm ERR! node_modules/typescript + # npm ERR! dev typescript@"5.3.3" from the root project + # npm ERR! peerOptional typescript@">=3.7.2" from tap@16.3.8 + # 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 react-scripts@5.0.1 + # npm ERR! node_modules/react-scripts + # npm ERR! react-scripts@"5.0.1" from @hyperledger/cacti-example-cbdc-bridging-frontend@2.0.0-alpha.2 + # npm ERR! examples/cactus-example-cbdc-bridging-frontend + # npm ERR! @hyperledger/cacti-example-cbdc-bridging-frontend@2.0.0-alpha.2 + # 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: typescript@4.9.5 + # npm ERR! node_modules/typescript + # npm ERR! peerOptional typescript@"^3.2.1 || ^4" from react-scripts@5.0.1 + # npm ERR! node_modules/react-scripts + # npm ERR! react-scripts@"5.0.1" from @hyperledger/cacti-example-cbdc-bridging-frontend@2.0.0-alpha.2 + # npm ERR! examples/cactus-example-cbdc-bridging-frontend + # npm ERR! @hyperledger/cacti-example-cbdc-bridging-frontend@2.0.0-alpha.2 + # 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/actionlint@v1.0.3 + 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 }}