Skip to content

Commit

Permalink
fix issue causing workflow to not trigger. (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfitchett authored Dec 30, 2024
1 parent 9f97cbf commit 4355929
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Dependabot Auto-Merge

on:
workflow_run:
workflows: ["Test Code"] # Name of the test-code.yml workflow
types:
- completed
branches: [ main ]

permissions:
contents: write
Expand All @@ -13,20 +13,23 @@ permissions:
jobs:
dependabot-auto-merge:
runs-on: ubuntu-latest
if: |
if: >
github.event.workflow_run.conclusion == 'success' &&
startsWith(github.event.workflow_run.head_commit.message, 'Bump') &&
github.actor == 'dependabot[bot]'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Enable auto-merge for Dependabot PRs
if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4355929

Please sign in to comment.