Skip to content

chore: promote next to main #648

chore: promote next to main

chore: promote next to main #648

name: Dependabot auto-merge
# Enables auto-merge on Dependabot PRs for non-major updates (patch + minor).
# Major bumps are left for a human to review. The PR still merges only once its
# required status checks pass (and any required review is satisfied).
on: pull_request_target
permissions:
contents: write
pull-requests: write
jobs:
auto-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
app-id: ${{ secrets.AIDD_BOT_APP_ID }}
private-key: ${{ secrets.AIDD_BOT_PRIVATE_KEY }}
- name: Dependabot metadata
id: meta
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
- name: Approve non-major updates
# Required-review rulesets (e.g. on `next`) block auto-merge until a
# review approves. Dependabot never gets one, so the app approves here.
# The app identity differs from the PR author, so the approval counts.
if: steps.meta.outputs.update-type != 'version-update:semver-major'
run: gh pr review --approve "${{ github.event.pull_request.html_url }}"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Enable auto-merge for non-major updates
if: steps.meta.outputs.update-type != 'version-update:semver-major'
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}