Skip to content

Commit

Permalink
Update dependabot_automerge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bndrmrtn committed Apr 10, 2024
1 parent b9d4b14 commit 305c4d4
Showing 1 changed file with 24 additions and 35 deletions.
59 changes: 24 additions & 35 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,30 @@
name: Dependabot auto-merge
on:
pull_request
name: "Test hcaptcha"

permissions:
contents: write
pull-requests: write
on:
push:
branches:
- master
- main
paths:
- 'hcaptcha/**'
pull_request:
paths:
- 'hcaptcha/**'

jobs:
wait_for_checks:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Wait for check is finished
uses: lewagon/wait-on-check-action@v1.3.3
id: wait_for_checks
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
running-workflow-name: wait_for_checks
check-regexp: Tests
repo-token: ${{ secrets.PR_TOKEN }}
wait-interval: 10
dependabot:
needs: [wait_for_checks]
name: Dependabot auto-merge
Tests:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
strategy:
matrix:
go-version:
- 1.21.x
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.0.0
- name: Fetch Repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
github-token: "${{ secrets.PR_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.PR_TOKEN}}
go-version: '${{ matrix.go-version }}'
- name: Run Test
working-directory: ./hcaptcha
run: go test -v -race ./...

0 comments on commit 305c4d4

Please sign in to comment.