Created
April 3, 2023 19:20
-
-
Save Silthus/822a8da5a80dfda47db0e6493f19f1ef to your computer and use it in GitHub Desktop.
Github Workflow for auto merging dependabot PRs
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
name: Dependabot auto-merge | |
on: pull_request | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
dependabot: | |
runs-on: ubuntu-latest | |
if: ${{ github.actor == 'dependabot[bot]' }} | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/fetch-metadata@v1.3.6 | |
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
# To get started with Dependabot version updates, you'll need to specify which | |
# package ecosystems to update and where the package manifests are located. | |
# Please see the documentation for all configuration options: | |
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | |
version: 2 | |
updates: | |
- package-ecosystem: "npm" | |
directory: "/" | |
schedule: | |
interval: "daily" | |
- package-ecosystem: "github-actions" | |
directory: "/" | |
schedule: | |
interval: "weekly" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment