-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (56 loc) · 1.63 KB
/
wc-update-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
56
57
58
59
60
61
62
name: Update README.md
on:
workflow_call:
secrets:
gh_app_id:
required: true
gh_app_private_key:
required: true
jobs:
update-readme:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{secrets.gh_app_id}}
private_key: ${{secrets.gh_app_private_key}}
repositories: >-
[
"${{github.event.repository.name}}"
]
permissions: >-
{
"contents": "write"
}
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
# Install ghcp
with:
aqua_version: v2.42.2
env:
AQUA_GITHUB_TOKEN: ${{github.token}}
- run: ghcp -v
env:
GITHUB_TOKEN: ${{github.token}}
- run: cat docs/HEADER.md docs/LIST.md docs/FOOTER.md > README.md
- run: |
if git diff --exit-code README.md; then
exit 0
fi
branch=${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}
if [ -z "$branch" ]; then
echo "::error ::branch is empty"
exit 1
fi
ghcp commit \
-r "$GITHUB_REPOSITORY" \
-m "docs: update README.md" \
-b "$branch" \
README.md
env:
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}}