Hello World CI #553
This file contains hidden or 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: Hello World CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 */6 * * *" | |
| workflow_dispatch: | |
| env: | |
| SS_API: ${{ secrets.SS_API }} | |
| jobs: | |
| update-total: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: go run main.go | |
| - name: Ensure no changes to git-tracked files | |
| id: check-for-changes | |
| run: | | |
| if git diff --exit-code; then | |
| echo "No changes to commit." | |
| echo "updates=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "updates=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Open PR with fixes | |
| if: steps.check-for-changes.outputs.updates == 'true' | |
| id: cpr | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| commit-message: "update summary" | |
| title: "update summary" | |
| branch: automated-update | |
| delete-branch: true | |
| - name: Enable Pull Request Automerge | |
| if: steps.cpr.outputs.pull-request-operation == 'created' | |
| uses: peter-evans/enable-pull-request-automerge@v3 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
| merge-method: squash |