-
Notifications
You must be signed in to change notification settings - Fork 58
44 lines (42 loc) · 1.25 KB
/
readme.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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.3"
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