mirror of
https://github.com/servo/servo
synced 2026-04-27 01:55:03 +02:00
The default GITHUB_TOKEN is created for 'github-bot' user and has limitations. Specifically, events generated by this github-bot cannot trigger additional workflows. This PR uses fine-grained PAT generated for @servo-bot account with the permissions scoped to servo/servo repo and grants the 'contents: write' and 'pull_request: write' permissions. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
23 lines
689 B
YAML
23 lines
689 B
YAML
name: Approve & merge successful dependabot patch upgrade PRs
|
|
on: pull_request
|
|
|
|
permissions:
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
dependabot:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.actor == 'dependabot[bot]' }}
|
|
steps:
|
|
- name: Dependabot metadata
|
|
id: metadata
|
|
uses: dependabot/fetch-metadata@v1
|
|
- name: Approve the PR & enable auto-merge
|
|
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
|
|
run: |
|
|
gh pr review --approve "$PR_URL"
|
|
gh pr merge --auto --merge "$PR_URL"
|
|
env:
|
|
PR_URL: ${{github.event.pull_request.html_url}}
|
|
GH_TOKEN: ${{secrets.SERVO_DEPENDABOT_TOKEN}}
|