Skip to content

Commit

Permalink
Add Auto Merge Forward for Dependabot PRs Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusdacoregio committed Jan 24, 2024
1 parent 47185f8 commit b883eef
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/auto-merge-forward.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Auto Merge Forward Dependabot PRs

on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: auto-merge-forward
cancel-in-progress: false

jobs:
count-open-dependabot-prs:
name: Count Open Dependabot PRs
runs-on: ubuntu-latest
outputs:
prs_count: ${{ steps.count.outputs.prs_count }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- id: count
env:
GH_TOKEN: ${{ github.token }}
run: echo "prs_count=$(gh pr list --app dependabot --state open --json number --jq length)" >> $GITHUB_OUTPUT

test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest
needs: [count-open-dependabot-prs]
if: needs.count-open-dependabot-prs.outputs.prs_count == 0
permissions:
contents: write
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Setup GitHub User
id: setup-gh-user
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Run Auto Merge Forward
id: run-auto-merge-forward
uses: marcusdacoregio/auto-merge-forward@ad89c068e52e87d56654341691867889ed729e3e
with:
branches: '6.1.x, 6.2.x, main'
dry-run: true
from-author: dependabot[bot]

0 comments on commit b883eef

Please sign in to comment.