Merge pull request #108 from svenfuchs/dependabot/github_actions/acti… #24
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: Ensure readme.md is up to date | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
ensure_readme_up_to_date: | |
name: Ensure readme.md is up to date | |
if: "contains(github.event.commits[0].message, '[ci skip]') == false" | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
bundler-cache: true | |
- name: generate readme | |
run: script/generate_readme | |
- name: Commit updated README.md | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
file_pattern: 'README.md' | |
- name: check that new readme is identical to the old | |
run: | | |
if [ -z "$(git status --porcelain README.md)" ] | |
then | |
echo "✅ README.md is up to date!" | |
else | |
echo "❌ README.md is out of date. Please run script/generate_readme and commit the results." | |
git diff | |
git status --porcelain | |
exit 1 | |
fi |