Controller Shared Data: Initial Proposal #108
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: | |
| branches: | |
| - main | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| - uses: pre-commit/action@v3.0.1 | |
| with: | |
| # HEAD is the not yet integrated PR merge commit +refs/pull/xxxx/merge | |
| # HEAD^1 is the PR target branch and HEAD^2 is the HEAD of the source branch | |
| extra_args: --from-ref HEAD^1 --to-ref HEAD | |
| - name: "Generate patch file" | |
| if: failure() | |
| run: | | |
| git diff-index -p HEAD > "${PATCH_FILE}" | |
| [ -s "${PATCH_FILE}" ] && echo "UPLOAD_PATCH_FILE=${PATCH_FILE}" >> "${GITHUB_ENV}" | |
| env: | |
| PATCH_FILE: pre-commit.patch | |
| - name: "Upload patch artifact" | |
| if: failure() && env.UPLOAD_PATCH_FILE != null | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.UPLOAD_PATCH_FILE }} | |
| path: ${{ env.UPLOAD_PATCH_FILE }} |