Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 75941cd

Browse files
ci(pre-commit): Comment when fixes are needed
1 parent 7436eab commit 75941cd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

‎.github/workflows/pre-commit-status.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,34 @@ jobs:
131131
gh pr edit ${{ steps.pr-info.outputs.pr_number }} --repo ${{ github.repository }} --remove-label 'Status: Pre-commit fixes required ⚠️'
132132
env:
133133
GH_TOKEN: ${{ github.token }}
134+
135+
- name: Comment on PR about pre-commit failures
136+
if: |
137+
steps.pr-info.outputs.artifacts_found == 'true' &&
138+
steps.pr-info.outputs.pre_commit_outcome == 'failure' &&
139+
steps.pr-info.outputs.pending_commit == '0'
140+
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
141+
with:
142+
pr-number: ${{ steps.pr-info.outputs.pr_number }}
143+
comment-tag: pre-commit-failure
144+
message: |
145+
## ⚠️ Pre-commit Hooks Failed
146+
147+
Some pre-commit hooks failed and require manual fixes.
148+
149+
**What to do:**
150+
1. 🔧 Fix the issues locally in your code
151+
2. 💾 Commit and push your changes
152+
3. 🔄 The hooks will run again automatically
153+
154+
[🔗 View detailed error log](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }})
155+
156+
- name: Remove pre-commit failure comment if resolved
157+
if: |
158+
steps.pr-info.outputs.artifacts_found == 'true' &&
159+
steps.pr-info.outputs.pre_commit_outcome == 'success'
160+
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
161+
with:
162+
pr-number: ${{ steps.pr-info.outputs.pr_number }}
163+
comment-tag: pre-commit-failure
164+
mode: delete

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /