Skip to content

Commit

Permalink
Push Bazel files for Dependabot PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mbg committed Jul 2, 2024
1 parent 8a927c7 commit cedb629
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- misc/bazel/**

permissions:
contents: read
contents: write

jobs:
test-linux:
Expand All @@ -30,6 +30,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref || '' }}
- name: Run tests
uses: ./go/actions/test
with:
Expand Down
16 changes: 14 additions & 2 deletions go/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,25 @@ runs:
- name: Regenerate Bazel files for Dependabot PR
if: github.event.pull_request.user.login == 'dependabot[bot]'
shell: bash
run: bazel run //go:gazelle
run: |
bazel run //go:gazelle
bazel run //go:gen
- name: Push Bazel files for Dependabot PR
if: github.event.pull_request.user.login == 'dependabot[bot]' && runner.os == 'Linux'
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add go/extractor/vendor/**
git commit -m 'Update Bazel build files for Dependabot PR'
git push
- name: Check checked-in generated code
if: inputs.run-code-checks == 'true'
shell: bash
run: |
bazel run go:gen
bazel run //go:gen
git add .
git diff --exit-code HEAD || (
echo "please run bazel run //go:gen"
Expand Down

0 comments on commit cedb629

Please sign in to comment.