Skip to content

Commit

Permalink
feat: Support pipelines without branch protections
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory Grieve committed Nov 13, 2023
1 parent 77bd7b7 commit dea374c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: The strategy to use when merging the PRs (can be 'merge', 'rebase' or 'squash')
type: string
default: merge
branch-protections:
description: Decide whether to enable auto merge if branch protections exist
type: boolean
default: true

jobs:
dependabot:
Expand All @@ -23,7 +27,7 @@ jobs:

- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --${{ inputs.merge-strategy }} "$PR_URL"
run: gh pr merge ${{inputs.branch-protections && '--auto' || '' }} --${{ inputs.merge-strategy }} "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit dea374c

Please sign in to comment.