Skip to content

Merge and Delete Renovate Branch #248

Merge and Delete Renovate Branch

Merge and Delete Renovate Branch #248

Workflow file for this run

name: Merge and Delete Renovate Branch
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch:
inputs:
mergeNow:
description: 'Merge and delete Renovate branches manually'
default: 'false'
required: false
jobs:
merge-and-delete-renovate-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Merge and Delete Renovate Branch
if: ${{ github.event.inputs.mergeNow == 'true' || github.event_name == 'schedule' }}
run: |
# Get all open pull requests
PR_LIST=$(gh pr list --json state:open --jq '.[] | select(.head.ref | startswith("renovate/")) | .number')
# Loop through each pull request and merge it
for PR in $PR_LIST; do
gh pr merge --auto $PR --delete-branch
done