Skip to content

Commit

Permalink
ci: auto-merge dependabot when build succeeds (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 authored Nov 8, 2024
1 parent 051b4e2 commit e3b4822
Show file tree
Hide file tree
Showing 25 changed files with 451 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/ansi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./ansi/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/cellbuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./cellbuf/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/colors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./colors/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/conpty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./conpty/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./editor/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./errors/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./examples/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./exp/golden/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/higherorder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./exp/higherorder/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./input/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./json/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/maps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./exp/maps/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./exp/open/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/ordered.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./exp/ordered/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/slice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./exp/slice/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/sshkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./sshkey/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./exp/strings/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/teatest-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
cache-dependency-path: ./exp/teatest/go.sum
- run: go build -v ./...
- run: go test -race -v ./...
dependabot:
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Loading

0 comments on commit e3b4822

Please sign in to comment.