Skip to content

SPEC §9: peer-derived text in observer-facing errors (boundary unresolved) #2670

SPEC §9: peer-derived text in observer-facing errors (boundary unresolved)

SPEC §9: peer-derived text in observer-facing errors (boundary unresolved) #2670

name: Dependabot auto-merge
on: pull_request
permissions: {}
jobs:
dependabot:
name: Auto-merge patch and minor updates
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' && github.event.pull_request.user.login == 'dependabot[bot]' # zizmor: ignore[bot-conditions] -- dual check is intentional: actor validates current trigger, user.login validates PR origin; on:pull_request (not pull_request_target) so actor is set by GitHub based on who pushed
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Exclude github_actions: dependabot/fetch-metadata reports that
# ecosystem name with an underscore. CI is the safety gate, so
# auto-merging action updates is circular — a broken update approves itself.
- name: Approve patch and minor updates
if: >-
(
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
) &&
steps.metadata.outputs.package-ecosystem != 'github_actions'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for patch and minor updates
if: >-
(
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
) &&
steps.metadata.outputs.package-ecosystem != 'github_actions'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}