Skip to content

Commit 9b54046

Browse files
committed
ci: check for changes to README and man page
Adds a check to CI on changes to either README.rst or git-secrets.1 that will fail if changes are made to one but not the other. Also update action/checkout to v4 Fixes: #243 Signed-off-by: ginglis13 <[email protected]>
1 parent 5357e18 commit 9b54046

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: "Sync README and man page"
3+
4+
on:
5+
push:
6+
branches:
7+
- 'master'
8+
paths:
9+
- 'README.rst'
10+
- 'git-secrets.1'
11+
pull_request:
12+
branches:
13+
- 'master'
14+
paths:
15+
- 'README.rst'
16+
- 'git-secrets.1'
17+
18+
jobs:
19+
sync-readme-man-page:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- run: |
24+
README_CHANGED=$(git diff --exit-code README.rst &>/dev/null; echo $?)
25+
MANPAGE_CHANGED=$(git diff --exit-code git-secrets.1 &>/dev/null; echo $?)
26+
27+
if [[ $README_CHANGE == $MANPAGE_CHANGED ]]; then
28+
echo "README and man page in sync."
29+
exit 0
30+
else
31+
echo "README and man page not in sync. Run `make man` to resolve."
32+
exit 1
33+
fi
34+

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
- run: make test

0 commit comments

Comments
 (0)