Repository navigation
Add Dependabot auto-merge workflow #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Dependabot Auto Merge | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - opened | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - synchronize | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - reopened | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: write # needed to update/merge PRs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: write # needed to push merge commits to the repo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| auto-merge: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.actor == 'dependabot[bot]' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Auto merge Dependabot PRs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: fastify/github-action-merge-dependabot@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| merge-method: squash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| target: minor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+23
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| auto-merge: | |
| runs-on: ubuntu-latest | |
| if: github.actor == 'dependabot[bot]' | |
| steps: | |
| - name: Auto merge Dependabot PRs | |
| uses: fastify/github-action-merge-dependabot@v3 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| merge-method: squash | |
| target: minor | |
| auto-merge-npm: | |
| runs-on: ubuntu-latest | |
| if: github.actor == 'dependabot[bot]' && contains(github.event.pull_request.title, 'npm') | |
| steps: | |
| - name: Auto merge Dependabot npm PRs | |
| uses: fastify/github-action-merge-dependabot@v3 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| merge-method: squash | |
| target: minor | |
| auto-merge-actions: | |
| runs-on: ubuntu-latest | |
| if: github.actor == 'dependabot[bot]' && (contains(github.event.pull_request.title, 'github-actions') || contains(github.event.pull_request.title, 'actions/')) | |
| steps: | |
| - name: Auto merge Dependabot GitHub Actions PRs | |
| uses: fastify/github-action-merge-dependabot@v3 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| merge-method: squash | |
| target: all |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| name: Dependabot Force Rebase | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| rebase: | ||
| runs-on: ubuntu-latest | ||
| if: github.actor == 'dependabot[bot]' | ||
| permissions: | ||
| contents: write # 👈 allows pushing commits to branches | ||
| pull-requests: write # 👈 allows updating PR metadata | ||
| steps: | ||
| - uses: peter-evans/rebase@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow will auto-merge Dependabot PRs without waiting for CI checks to pass. This is risky because it could merge broken code if tests fail. The workflow should include a check to ensure the CI workflow completes successfully before merging. Consider adding a dependency on the CI job status or using the action's
approve-onlyoption with GitHub's built-in auto-merge that waits for status checks.