ci: check for changes to README and man page #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | ||
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 | ||