Skip to content

chore: add avm-res-migrate metadata (#318) #81

chore: add avm-res-migrate metadata (#318)

chore: add avm-res-migrate metadata (#318) #81

name: housekeeping - PR Cleanup
on:
push:
branches:
- main
workflow_dispatch:
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Clean up unmerged PRs that used to target PR head branch but now target main
run: |
PULL_REQUESTS=$(gh pr list --repo ${{ github.repository }} --base main --search "test: update mock module" --json number)
echo "$PULL_REQUESTS" | jq -r '.[] | .number' | xargs -I% gh pr close --repo ${{ github.repository }} % --delete-branch --comment "Unmerged updates to mock modules closed as source PR is now merged."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}