Skip to content

Commit f7c7d1e

Browse files
committed
Update GitHub Actions samples
- latest version of pre-commit/action - recommend the pull_request+push to main strategy for GitHub Actions.
1 parent 46d1968 commit f7c7d1e

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

README.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ If the repository does not already have a GitHub Actions workflow, create a file
5353

5454
name: CI
5555

56-
"on": [push, pull_request]
56+
'on':
57+
pull_request:
58+
push:
59+
branches: [main]
5760

5861
jobs:
5962
pre-commit:
@@ -69,7 +72,7 @@ If the repository does not already have a GitHub Actions workflow, create a file
6972
run: brew install pandoc
7073

7174
- name: Run pre-commit hooks
72-
uses: pre-commit/action@v2.0.0
75+
uses: pre-commit/action@v2.0.3
7376

7477
This workflow will generate a build "failure" if the plain-text mirror file is out of date with the Word file in the repository — as might happen if a contributor did not install pre-commit locally.
7578

@@ -81,7 +84,10 @@ The ``.github/workflows/ci.yaml`` file::
8184

8285
name: CI
8386

84-
"on": [push, pull_request]
87+
'on':
88+
pull_request:
89+
push:
90+
branches: [main]
8591

8692
jobs:
8793
pre-commit:
@@ -99,7 +105,7 @@ The ``.github/workflows/ci.yaml`` file::
99105
run: brew install pandoc
100106

101107
- name: Run pre-commit hooks
102-
uses: pre-commit/action@v2.0.0
108+
uses: pre-commit/action@v2.0.3
103109
with:
104110
token: ${{ secrets.GITHUB_TOKEN }}
105111

0 commit comments

Comments
 (0)