Skip to content

Commit

Permalink
Update automerge.yml to shared
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneMcC committed Aug 9, 2023
1 parent 564368d commit 17c335a
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Dependabot auto-merge patch
on: pull_request
name: Dependabot auto-merge minor/patch
on:
workflow_dispatch:
pull_request:

permissions:
contents: write
Expand All @@ -8,20 +10,5 @@ permissions:

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot patch or minor version bumps
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: |
gh label create AutoMerged -c '#B60205' -d 'PR was automatically merged by an action.' 2>/dev/null
gh pr edit --add-label "AutoMerged" "$PR_URL"
gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
uses: ShaneMcC/.github/.github/workflows/automergeMinorOrPatch.yml@master
secrets: inherit

0 comments on commit 17c335a

Please sign in to comment.