chore(error): Show error message on API request failures #763
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: | |
| push: | |
| pull_request: | |
| permissions: {} | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust toolchain | |
| run: rustup toolchain install | |
| - name: Set up Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| - name: Detect code style issues | |
| uses: pre-commit/action@1b06ec171f2f6faa71ed760c4042bd969e4f8b43 | |
| env: | |
| SKIP: no-commit-to-branch | |
| - 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ env.UPLOAD_PATCH_FILE }} | |
| path: ${{ env.UPLOAD_PATCH_FILE }} |