-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Create dependabot automerge action (#187)
* 🎨 Create dependabot automerge action * 📝 Add permissions * 📝 Rename action * 🎨 using explicit ubuntu version * 🚚 Move permissions * 📝 Update dependabot must haves
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# see: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request | ||
name: Dependabot Auto-Merge | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
dependabot: | ||
|
||
name: auto-merge | ||
runs-on: ubuntu-22.04 | ||
if: github.actor == 'dependabot[bot]' | ||
|
||
steps: | ||
- name: Load dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Enable auto-merge for Dependabot PRs | ||
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' | ||
run: gh pr merge --auto --merge "$PR_URL" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -23,6 +23,28 @@ jobs: | |
In this section you can find examples of how to use template workflows. For more information, please take a look at the templates. | ||
### Auto-Merge Dependabot | ||
<details> | ||
<summary>The action can be used to auto-merge a dependabot PR with minor and patch updates.</summary> | ||
The action is called by creating a PR. Dependabot must have ownership of the corresponding dependency files in order to be able to merge the PRs. | ||
```yml | ||
name: Enable Dependabot Auto-Merge | ||
|
||
on: pull_request | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot: | ||
uses: Staffbase/gha-workflows/.github/workflows/[email protected] | ||
``` | ||
</details> | ||
### AutoDev | ||
<details> | ||
|