Skip to content

Commit

Permalink
fix(toil): enable more auto-merge for Dependabot (#1479)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommartensen authored Feb 6, 2025
1 parent 840163c commit 768f310
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
12 changes: 9 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ updates:
day: 'wednesday'
reviewers:
- 'stackrox/infra'
labels:
- 'auto-merge'

- package-ecosystem: 'docker'
directory: 'image/'
Expand All @@ -30,11 +32,15 @@ updates:
day: 'wednesday'
reviewers:
- 'stackrox/infra'
labels:
- 'auto-merge'

- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
day: 'wednesday'
reviewers:
- "stackrox/infra"
- 'stackrox/infra'
labels:
- 'auto-merge'
18 changes: 13 additions & 5 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ jobs:
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
github-token: "${{ secrets.RHACS_BOT_GITHUB_TOKEN }}"

- name: Approve a PR
if: contains(github.event.pull_request.labels, 'auto-merge') && (steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch')
run: gh pr review --approve "${PR_URL}"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.RHACS_BOT_GITHUB_TOKEN }}

- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr merge --auto --squash "$PR_URL"
if: contains(github.event.pull_request.labels, 'auto-merge') && (steps.metadata.outputs.update-type == 'version-update:semver-minor' || 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}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.RHACS_BOT_GITHUB_TOKEN }}

0 comments on commit 768f310

Please sign in to comment.