Skip to content

Commit 9311134

Browse files
committed
Allow pre-commit update PRs to run checks on approval
1 parent bffe4db commit 9311134

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
jobs:
2-
complete_coveralls:
2+
eval-rules:
3+
name: Evaluate Rules
4+
outputs:
5+
should_run: ${{ steps.eval-rules.outputs.should_run }}
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Eval Rules
9+
id: eval-rules
10+
env:
11+
SHOULD_RUN: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && github.event.pull_request.title == 'Update pre-commit hooks') }}
12+
run: echo "should_run=${SHOULD_RUN}" >> "$GITHUB_OUTPUT"
13+
complete-coveralls:
14+
if: needs.eval-rules.outputs.should_run == 'true'
315
needs: test-multi-python
16+
name: Check Coveralls
417
runs-on: ubuntu-latest
518
steps:
6-
- name: Coveralls Finished
19+
- name: Coveralls
720
uses: coverallsapp/github-action@master
821
with:
922
github-token: ${{ secrets.GITHUB_TOKEN }}
1023
parallel-finished: true
1124
lint-multi-os:
25+
if: needs.eval-rules.outputs.should_run == 'true'
1226
name: Lint ${{ matrix.os }}
27+
needs: eval-rules
1328
runs-on: ${{ matrix.os }}
1429
steps:
1530
- uses: actions/checkout@v3
@@ -36,7 +51,9 @@ jobs:
3651
matrix:
3752
os: [ macOS-latest, ubuntu-latest, windows-latest ]
3853
test-multi-os:
54+
if: needs.eval-rules.outputs.should_run == 'true'
3955
name: Test ${{ matrix.os }}
56+
needs: eval-rules
4057
runs-on: ${{ matrix.os }}
4158
steps:
4259
- uses: actions/checkout@v3
@@ -62,7 +79,9 @@ jobs:
6279
matrix:
6380
os: [ macOS-latest, ubuntu-latest, windows-latest ]
6481
test-multi-python:
82+
if: needs.eval-rules.outputs.should_run == 'true'
6583
name: Test Python ${{ matrix.python-version }}
84+
needs: eval-rules
6685
runs-on: ubuntu-latest
6786
steps:
6887
- uses: actions/checkout@v3
@@ -95,7 +114,8 @@ jobs:
95114
matrix:
96115
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
97116
test-network:
98-
if: endsWith(inputs.package, 'praw')
117+
if: endsWith(inputs.package, 'praw') && needs.eval-rules.outputs.should_run == 'true'
118+
needs: eval-rules
99119
name: Test Network Request
100120
runs-on: ubuntu-latest
101121
steps:

0 commit comments

Comments
 (0)