Update data #705
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
name: "Update data" | |
on: | |
schedule: | |
- cron: '15 */6 * * *' | |
push: | |
branches: | |
- 'main' | |
paths: | |
- '**.go' | |
- '**.sh' | |
jobs: | |
pull-data: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.17.13' | |
- name: Pull data | |
run: | | |
./.script/pull.sh | |
- name: Commit | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config -l | |
git add . | |
if git diff --cached --exit-code; then | |
echo "No changes to commit." | |
exit 0 | |
else | |
git commit -m "feat: update data" | |
git rebase main | |
git push origin main | |
git tag $(./.script/version.sh minor) | |
git push origin --tags | |
fi |