Skip to content

Commit

Permalink
ci: auto update generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Jan 25, 2024
1 parent 4a73be0 commit ffc6039
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Auto generate sources"

on:
schedule:
- cron: '42 14 * * */2'
workflow_dispatch:

jobs:
autogen:
name: Analyze
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 ./...
- 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

0 comments on commit ffc6039

Please sign in to comment.