This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto-merge capabilities for dependabot
- Loading branch information
1 parent
9599947
commit d65fc62
Showing
2 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,32 @@ jobs: | |
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: "./build/reports/jacoco/jacocoTestReport.xml" | ||
|
||
dependabot_auto_merge: | ||
if: ${{ github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]' }} | ||
runs-on: ubuntu-latest | ||
needs: ci | ||
steps: | ||
# If the PR is created by Dependabot run additional steps | ||
- name: Fetch Dependabot metadata | ||
id: metadata | ||
uses: dependabot/[email protected] | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Approve a Dependabot PR | ||
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || | ||
steps.metadata.outputs.update-type == 'version-update:semver-patch' }} | ||
# Approving the PR and waiting for 5 sec to let GitHub UI to reflect the changes | ||
run: gh pr review --approve "$PR_URL" && sleep 5 | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.REVIEWER_GITHUB_TOKEN }} | ||
|
||
- name: Enable auto-merge for Dependabot PRs | ||
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || | ||
steps.metadata.outputs.update-type == 'version-update:semver-patch' }} | ||
run: gh pr merge --auto --rebase "$PR_URL" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |