-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||