-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(pre-commit): Enforce that the pre-commit checks are run before merge
- Loading branch information
1 parent
a45b5af
commit 62ef661
Showing
2 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Report Pre-commit Check Status | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, reopened, synchronize, labeled, unlabeled] | ||
|
||
permissions: | ||
statuses: write | ||
|
||
jobs: | ||
report-run: | ||
name: Check if the PR has run the pre-commit checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Wait for pre-commit checks to complete | ||
uses: lucasssvaz/wait-on-workflow@v1 | ||
id: wait-on-workflow | ||
with: | ||
workflow: pre-commit.yml | ||
sha: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Report success | ||
if: | | ||
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') && | ||
steps.wait-on-workflow.outputs.conclusion == 'success' | ||
uses: conda/actions/set-commit-status@v24.2.0 | ||
with: | ||
context: "Pre-commit checks" | ||
state: success | ||
description: All pre-commit checks passed | ||
|
||
- name: Report pending | ||
if: | | ||
!contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') || | ||
steps.wait-on-workflow.outputs.conclusion != 'success' | ||
uses: conda/actions/set-commit-status@v24.2.0 | ||
with: | ||
context: "Pre-commit checks" | ||
state: pending | ||
description: The pre-commit checks need to be successful before merging |
This file contains 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