-
Notifications
You must be signed in to change notification settings - Fork 144
57 lines (48 loc) · 1.49 KB
/
docs.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Docs
on:
schedule:
- cron: '43 8 10 * *' # Run monthly on the 10th, at 8:43am
workflow_dispatch: # Can be run manually from GitHub UI
jobs:
generate-doc:
runs-on: ubuntu-latest
permissions:
contents: write # Permit git push
pull-requests: write
steps:
- name: Set TODAY env var
run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Checkout project
uses: actions/checkout@v4
- name: Create branch
run: git checkout -b docs-$TODAY
- name: Setup Ruby
# Docs: https://github.com/ruby/setup-ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # Runs bundle install and caches gems
ruby-version: .ruby-version
- name: Generate repos markdown file
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bin/get_project_data > repos.md
- name: Configure git user
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: Commit
run: |
git add repos.md
git commit -m "Update repos.md $TODAY"
- name: Push branch
run: |
git config push.autoSetupRemote true
git push
- name: Open pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create \
--fill \
--reviewer eliotsykes \
--base ${{ github.ref_name }}