Skip to content

Update renovatebot/github-action action to v46.2.1 #22

Update renovatebot/github-action action to v46.2.1

Update renovatebot/github-action action to v46.2.1 #22

name: "Approve and auto-merge Renovate Pull Requests with automerge label"
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
branches:
- main
env:
PR_URL: ${{github.event.pull_request.html_url}}
# By default, the GitHub Actions workflow will get a GITHUB_TOKEN with read-only permissions.
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
permissions:
# This Allows the GITHUB_TOKEN to approve pull requests
pull-requests: write
# This Allows the GITHUB_TOKEN to auto merge pull requests
contents: write
jobs:
approve-pr:
runs-on: ubuntu-latest
if: ${{ (github.actor == 'team-builds-bot') && contains(github.event.pull_request.labels.*.name, 'autoapprove') }}
steps:
- name: Approve a renovate PR with the 'autoapprove' label
run: gh pr review --approve "$PR_URL"
- name: Enable auto-merge for the PR
run: gh pr merge --auto --squash "$PR_URL"