-
Notifications
You must be signed in to change notification settings - Fork 55
40 lines (33 loc) · 1 KB
/
gen.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
name: "Auto generate sources"
on:
schedule:
- cron: '42 14 * * *'
workflow_dispatch:
jobs:
autogen:
name: Auto generate sources
runs-on: 'ubuntu-latest'
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
- name: Generate
run: |
go generate ./...
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes if any
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# If there are changes to the generated files, commit them
if [[ -n $(git status --porcelain) ]]; then
git add .
git commit -m "chore: update generated files" -m "[skip ci]"
git push
else
echo "::notice::Generated files are up to date."
fi