diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..663bbd3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +version: 2 +updates: + # Enable version updates for npm + - package-ecosystem: "npm" + # Look for "package.json" and "lock" files in the root directory + directory: "/" + # Check the npm registry for updates every day (weekdays) + schedule: + interval: "daily" + # Prefix all commit messages with "npm" + commit-message: + prefix: "[npm]" + # ignore all major(BREAKING-CHANGE) version updates + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] + # Allow up to 10 open pull requests for npm dependencies + open-pull-requests-limit: 10 + # Separate sections of the branch name with a hyphen + pull-request-branch-name: + separator: "-" + # Always increase the version in both "package.json" and "lock" files + versioning-strategy: increase diff --git a/.github/workflows/merge-dependabot-prs.yml b/.github/workflows/merge-dependabot-prs.yml new file mode 100644 index 0000000..e924429 --- /dev/null +++ b/.github/workflows/merge-dependabot-prs.yml @@ -0,0 +1,27 @@ +name: Merge Dependabot PRs +on: pull_request + +permissions: write-all + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1.1.1 + with: + github-token: '${{ secrets.GITHUB_TOKEN }}' + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}