fix(aws-diagram-mcp-server): replace Unix-only signal with cross-plat… #10137
Workflow file for this run
This file contains hidden or 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
| name: pre-commit | |
| on: | |
| pull_request: | |
| push: | |
| permissions: {} | |
| jobs: | |
| detect-precommit: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| precommits: ${{ steps.find-precommit.outputs.precommits }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Find precommit configurations | |
| id: find-precommit | |
| working-directory: . | |
| run: | | |
| PRECOMMITS=$(find . -name ".pre-commit-config.yaml" -exec dirname {} \; | sed 's/^\.\///' | jq -R -s -c 'split("\n")[:-1]') | |
| echo "precommits=$PRECOMMITS" >> $GITHUB_OUTPUT | |
| pre-commit: | |
| needs: [detect-precommit] | |
| if: ${{ needs.detect-precommit.outputs.precommits != '[]' && needs.detect-precommit.outputs.precommits != '' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| precommit: ${{ fromJson(needs.detect-precommit.outputs.precommits) }} | |
| name: Precommit ${{ matrix.precommit }} | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ${{ matrix.precommit }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 #v6.2.0 | |
| with: | |
| python-version-file: ${{ matrix.precommit }}/.python-version | |
| - run: | | |
| echo "github.workspace=${{ github.workspace }}" | |
| echo "env.GITHUB_WORKSPACE=${{ env.GITHUB_WORKSPACE }}" | |
| echo "vars.GITHUB_WORKSPACE=${{ vars.GITHUB_WORKSPACE }}" | |
| python -m pip install --require-hashes --requirement ${{ github.workspace }}/.github/workflows/pre-commit-requirements.txt | |
| python -m pip freeze --local | |
| - uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 #v5.0.2 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-3|${{ runner.os }}|${{ hashFiles(matrix.precommit) }} | |
| - name: Set SKIP variable for main branch | |
| if: github.ref == 'refs/heads/main' | |
| run: echo "SKIP=no-commit-to-branch" >> $GITHUB_ENV | |
| - run: SKIP="$SKIP" pre-commit run --show-diff-on-failure --color=always --all-files | |
| working-directory: ${{ matrix.precommit }} |