Skip to content

Commit

Permalink
[IMP] partner: pre-commit improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
az-adhoc authored and vib-adhoc committed Feb 28, 2025
1 parent a56b720 commit 64b716c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ name: pre-commit

on:
push:
branches: "*.0"
pull_request:
branches: "[0-9][0-9].0"
pull_request_target:

jobs:
pre-commit:
Expand All @@ -16,6 +16,8 @@ jobs:
-
name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
-
id: setup-python
name: Setup Python
Expand All @@ -32,3 +34,15 @@ jobs:
-
name: Pre-commit
uses: pre-commit/action@v3.0.1
-
name: Create commit status
if: github.event_name == 'pull_request_target'
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
-d '{"state":"${{ steps.precommit.outcome }}","context":"mergebot/pre-commit"}' \
--fail

0 comments on commit 64b716c

Please sign in to comment.