Skip to content

Commit

Permalink
ci: check for changes to README and man page
Browse files Browse the repository at this point in the history
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.

Fixes: awslabs#243

Signed-off-by: ginglis13 <ginglis05@gmail.com>
  • Loading branch information
ginglis13 committed Oct 10, 2023
1 parent 5357e18 commit 3226ed2
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/sync-readme-manpage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: "Sync README and man page"

on:
push:
branches:
- 'master'
paths:
- 'README.rst'
- 'git-secrets.1'
pull_request:
branches:
- 'master'
paths:
- 'README.rst'
- 'git-secrets.1'

jobs:
sync-readme-man-page:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
README_CHANGED=$(git diff --exit-code README.rst &>/dev/null; echo $?)
MANPAGE_CHANGED=$(git diff --exit-code git-secrets.1 &>/dev/null; echo $?)

if [[ $README_CHANGE == $MANPAGE_CHANGED ]]; then
echo "README and man page in sync."
exit 0
else
echo "If changes are made to one of {README.rst, git-secrets.1}, changes need to be made to the other."
exit 1
fi

0 comments on commit 3226ed2

Please sign in to comment.