Updates Go dependencies via gobump #12
Workflow file for this run
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: "Updates Go dependencies" | |
| on: # yamllint disable-line rule:truthy | |
| workflow_dispatch: | |
| schedule: | |
| # Every Tuesday at 15:00 | |
| - cron: "0 15 * * 2" | |
| jobs: | |
| update-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Update go.mod and open a PR | |
| env: | |
| GH_TOKEN: ${{ secrets.SCHUTZBOT_GITHUB_ACCESS_TOKEN }} | |
| run: | | |
| echo "```" > go.log | |
| go get -u ./... 2>&1 | tee -a go.log | |
| go mod tidy 2>&1 | tee -ago.log | |
| echo "```" >> go.log | |
| # Make a PR when needed | |
| if git diff --exit-code; then echo "No changes"; exit 0; fi | |
| git config user.name "schutzbot" | |
| git config user.email "schutzbot@gmail.com" | |
| branch="schutz-gobump-$(date -I)" | |
| git checkout -b "${branch}" | |
| git add -A | |
| git commit -m "build(deps): Update dependencies" | |
| git push -f "https://$GH_TOKEN@github.com/schutzbot/images.git" | |
| gh pr create \ | |
| -t "Update dependencies $(date -I)" \ | |
| -F go.log \ | |
| --repo "osbuild/bootc-image-builder" \ | |
| --base "main" \ | |
| --head "schutzbot:${branch}" |