-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.56 KB
/
readme-generator.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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: README Generator
on:
workflow_dispatch: {}
push:
branches: ["main"]
pull_request:
paths:
- ".github/workflows/readme-generator.yaml"
- ".github/scripts/README_template.j2"
- ".github/scripts/readme-generator.py"
- "Dockerfile"
- "requirements.txt"
jobs:
generate-readme:
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Check out repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
token: "${{ steps.app-token.outputs.token }}"
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.12"
- name: Install dependencies
run: pip install Jinja2
- name: Generate README
run: cd .github/scripts && python3 readme-generator.py
- name: Show changes
run: cat README.md
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5
if: "${{ github.event_name == 'push' }}"
with:
commit_message: "[bot] Update README"
file_pattern: "README.md"
branch: ${{ github.ref }}