forked from get-woke/woke
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.03 KB
/
update-woke-usage.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
name: Update docs/snippets/woke.md
on:
push:
branches: [ main ]
paths:
- "cmd/**/*.go"
jobs:
woke-usage-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.17.x
- run: go run cmd/docs/main.go docs/snippets
- name: push commit
env:
SHA: ${{ github.sha }}
run: |
SHORT_SHA=$(echo $SHA | head -c 6)
# https://api.github.com/users/github-actions%5Bbot%5D
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs/snippets/woke.md
if git diff --cached --exit-code; then
echo "No changes to commit"
else
git commit -m "docs: autogenerated update for docs/snippets/woke.md: \`$SHORT_SHA\`" -m "GitHub Action run ${GITHUB_RUN_NUMBER}, commit: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${SHA}"
git push
fi