-
Notifications
You must be signed in to change notification settings - Fork 66
44 lines (37 loc) · 1.2 KB
/
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
on:
push:
branches:
- master
name: Generate readme
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for Git to git push
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: "go.mod"
id: go
- name: Generate readme
run: go run ./tools/readme-docs/main.go
- name: Commit changes
continue-on-error: true
run: |
git checkout master
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add README.md
COAUTHOR=`git log -1 --pretty=format:'Co-authored-by: %an <%ae>'`
git commit -m "docs: updated readme" -m "$COAUTHOR"
- name: Push changes
if: ${{ success() }}
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git push