-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.46 KB
/
generate-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: Generate action documentation
on:
push:
branches: [trunk]
paths:
- '.github/workflows/generate-docs.yml'
- '**/action.yml'
- 'README.md'
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}-${{ github.event_name }}'
cancel-in-progress: true
permissions:
contents: write
jobs:
generate-docs:
name: Generate action documentation
runs-on: elvia-runner
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get GitHub App token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Generate docs
uses: 3lvia/gh-actions-docs@v1
with:
ignore-files: 'my-new-action/action.yml'
ignore-headers: '# core-github-actions-templates,## Table of Contents'
run-prettier: 'true'
- name: Commit changes
shell: bash
run: |
if [[ -z "$(git status --porcelain)" ]]; then
echo 'No changes to commit.'
exit 0
fi
git config user.email '${{ vars.GH_APP_USER_EMAIL }}'
git config user.name '${{ vars.GH_APP_USERNAME }}'
git add README.md
git commit -m 'Update action documentation'
git push
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}