1
- name : Report Pre-commit Check Status
1
+ name : Run Pre-commit Checks
2
2
3
3
on :
4
4
pull_request_target :
@@ -8,8 +8,8 @@ permissions:
8
8
statuses : write
9
9
10
10
jobs :
11
- report-run :
12
- name : Check if the PR has run the pre-commit checks
11
+ report-pending :
12
+ name : Report pre-commit workflow as pending
13
13
runs-on : ubuntu-latest
14
14
steps :
15
15
- name : Report pending
@@ -19,22 +19,30 @@ jobs:
19
19
state : pending
20
20
description : The pre-commit checks need to be successful before merging
21
21
22
- - name : Wait for pre-commit checks to complete
23
- uses : lucasssvaz/wait-on-workflow@v1
24
- if : |
25
- contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge')
26
- id : wait-on-workflow
22
+ run-pre-commit :
23
+ name : Run pre-commit checks
24
+ needs : report-pending
25
+ if : |
26
+ contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge')
27
+ uses : ./.github/workflows/pre-commit.yml
28
+ secrets : inherit
29
+
30
+ report-success :
31
+ name : Push changes and report success
32
+ needs : run-pre-commit
33
+ runs-on : ubuntu-latest
34
+ if : |
35
+ contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') &&
36
+ needs.run-pre-commit.result == 'success'
37
+ steps :
38
+ - name : Push changes using pre-commit-ci-lite
39
+ uses : lucasssvaz/lite-action@main
27
40
with :
28
- timeout : 10
29
- interval : 30
30
- workflow : pre-commit.yml
31
- sha : ${{ github.event.pull_request.head.sha || github.sha }}
41
+ msg : " ci(pre-commit): Apply automatic fixes"
42
+ run : ${{ needs.run-pre-commit.outputs.run-id }}
32
43
33
44
- name : Report success
34
45
uses :
conda/actions/[email protected]
35
- if : |
36
- contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') &&
37
- steps.wait-on-workflow.outputs.conclusion == 'success'
38
46
with :
39
47
context : " Pre-commit checks"
40
48
state : success
0 commit comments