Skip to content

Auto generate sources #59

Auto generate sources

Auto generate sources #59

Workflow file for this run

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: Checkout GoLang repository
run: |
git clone --progress --no-checkout https://github.com/golang/go.git ${{ runner.temp }}/go
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ">=1.22.0"
- name: Generate
run: |
go generate ./...
env:
GORE_GO_REPO: ${{ runner.temp }}/go
- 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