Skip to content

.github/workflows/update-output.yaml #84

.github/workflows/update-output.yaml

.github/workflows/update-output.yaml #84

# Auto Run and Commit
name: Update Output
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
run_and_commit:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20' # 替换为你希望使用的Go版本
- name: Install dependencies
run: go mod tidy
- name: Run go run .
run: go run .
- name: Check for changes
id: check_changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "CHANGES=true" >> $GITHUB_ENV
fi
- name: Commit changes
if: env.CHANGES == 'true'
uses: stefanzweifel/git-auto-commit-action@v4