mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
ci: Add PR comment and failure handling for pre-commit checks
This commit is contained in:
parent
cb8d372912
commit
3e01b7dccf
1 changed files with 16 additions and 0 deletions
16
.github/workflows/pre-commit.yml
vendored
16
.github/workflows/pre-commit.yml
vendored
|
|
@ -13,3 +13,19 @@ jobs:
|
|||
with:
|
||||
python-version: '3.11'
|
||||
- uses: pre-commit/action@v3.0.0
|
||||
id: precommit
|
||||
continue-on-error: true
|
||||
- name: Comment on PR if pre-commit failed
|
||||
if: steps.precommit.outcome == 'failure'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: '❌ Pre-commit checks failed. Please run `pre-commit run --all-files` locally and fix the issues.'
|
||||
})
|
||||
- name: Exit with pre-commit status
|
||||
if: steps.precommit.outcome == 'failure'
|
||||
run: exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue