Updates Go dependencies via gobump #15
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: | |
| - cron: "0 15 * * 2" | |
| jobs: | |
| update-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 'stable' | |
| cache-dependency-path: bib/go.sum | |
| - name: Update go.mod and open a PR | |
| env: | |
| GH_TOKEN: ${{ secrets.SCHUTZBOT_GITHUB_ACCESS_TOKEN }} | |
| run: | | |
| pushd bib/ | |
| echo '```' > go.log | |
| go get -u ./... 2>&1 | tee -a go.log | |
| go mod tidy 2>&1 | tee -a go.log | |
| echo '```' >> go.log | |
| popd | |
| 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 +%Y-%m-%d)" | |
| git checkout -b "${branch}" | |
| git add -A | |
| git commit -m "build(deps): Update dependencies" | |
| git push -f https://x-access-token:${GH_TOKEN}@github.com/schutzbot/images.git "${branch}" | |
| gh pr create \ | |
| --title "Update dependencies $(date +%Y-%m-%d)" \ | |
| --body-file go.log \ | |
| --repo "osbuild/bootc-image-builder" \ | |
| --base "main" \ | |
| --head "schutzbot:${branch}" |