-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (50 loc) · 2.08 KB
/
render-rfcs-pr.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Do not change the filename. This is triggered from https://github.com/giantswarm/rfc/tree/main/.github/workflows
# (see `on:workflow_dispatch` below), i.e. whenever the RFCs change.
name: Render RFCs and create/update PR on changes
on:
# In case the `workflow_dispatch`/`push` triggers don't work, try regularly
schedule:
- cron: "0 12,17 * * MON-FRI"
push:
workflow_dispatch:
jobs:
render-rfcs-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path: handbook
- name: Checkout code
uses: actions/checkout@v4
with:
repository: 'giantswarm/rfc'
path: rfc
- name: Render RFCs
env:
RFCS_DIR: "${{ github.workspace }}/rfc"
run: |
make rfcs
# https://github.com/peter-evans/create-pull-request/issues/783
sudo chown -R $USER:$USER content/docs/rfcs
working-directory: "${{ github.workspace }}/handbook"
- name: Create or update pull request
uses: peter-evans/create-pull-request@v7
if: ${{ github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: "${{ secrets.TOKEN }}"
with:
path: handbook
commit-message: "Update rendered RFCs"
title: "Update generated RFCs content"
branch: update-generated-rfcs-content
body: |
This PR has been created automatically by the 'Render RFCs and create/update PR on changes' GitHub workflow
to keep rendered RFCs in the handbook up to date.
Please review and merge, or check in `#sig-docs` chat if something is wrong.
# This does not work if triggered from the `rfc` repo (https://github.com/giantswarm/rfc/blob/main/.github/workflows/render.yaml) due to error
# "Unable to request reviewers. If requesting team reviewers a 'repo' scoped PAT is required." (using Taylor Bot token).
# So instead, sig-docs was added to CODEOWNERS on RFC-related paths.
# ---
# team-reviewers: |
# giantswarm/sig-docs