name: Go Dependencies

on:
  schedule:
    - cron: '0 9 * * *'
  workflow_dispatch:

jobs:
  go-deps:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: bazelbuild/setup-bazelisk@v2
      - uses: actions/setup-go@v3
        with:
          go-version: '>=1.18.0'
      - name: Update Go Modules
        run: go mod tidy
      - name: Update Bazel Repositories
        run: bazel run :gazelle-update-repos
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v4
        with:
          commit-message: Update Go Dependencies
          title: Update Go Dependencies
          body: Auto-generated Go dependency updates.
          branch: go-deps-auto-update
          delete-branch: true

name: Go Dependencies

on:
  schedule:
    - cron: '0 9 * * *'
  workflow_dispatch:

jobs:
  go-deps:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: bazelbuild/setup-bazelisk@v2
      - uses: actions/setup-go@v3
        with:
          go-version: '>=1.18.0'
      - name: Update Go Modules
        run: go mod tidy
      - name: Update Bazel Repositories
        run: bazel run :gazelle-update-repos
      - name: Build
        run: bazel build ...
      - name: Test
        run: bazel test --test_output=errors ...
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v4
        with:
          commit-message: Update Go Dependencies
          title: Update Go Dependencies
          body: Auto-generated Go dependency updates.
          branch: go-deps-auto-update
          delete-branch: true

Build and test before creating PR
Build and test before creating PR
