diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 149c55eb585..d5b6284bc0c 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -21,16 +21,18 @@ # name: Auto-merge Dependabot PRs -on: pull_request - -permissions: - contents: write - pull-requests: write +on: + pull_request_target: + types: [opened, reopened, synchronize, ready_for_review, labeled] jobs: dependabot: + if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' runs-on: ubuntu-latest - if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'influxdata/influxdb-client-java' + permissions: + contents: write + pull-requests: write + checks: read steps: - name: Dependabot metadata id: metadata @@ -43,7 +45,6 @@ jobs: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Enable auto-merge for Dependabot PRs - if: contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch' run: gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}}