-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (48 loc) · 1.54 KB
/
render-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
45
46
47
48
49
50
51
52
53
54
55
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Render Readme"
on:
workflow_call:
secrets:
BOT_APP_ID:
description: The App ID of the GitHub App
required: true
BOT_APP_PRIVATE_KEY:
description: The private key of the GitHub App
required: true
jobs:
render-readme:
name: Render README
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout
uses: actions/checkout@v4
with:
token: "${{ steps.app-token.outputs.token }}"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: Install Python Requirements
shell: bash
run: pip install --requirement requirements.txt && pip freeze
- name: Render README
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
shell: bash
run: python ./scripts/render-readme.py
- name: Commit Changes
shell: bash
run: |
git config --global user.name "bot-ross"
git config --global user.email "98030736+bot-ross[bot]@users.noreply.github.com"
git add ./README.md
git commit -m "chore: render README.md" || echo "No changes to commit"
git push origin || echo "No changes to push"