Skip to content

🤖 Auto-update server-publicized redist files #287

🤖 Auto-update server-publicized redist files

🤖 Auto-update server-publicized redist files #287

name: "Cleanup.RedistBranch"
on:
pull_request:
types:
- closed
jobs:
cleanup-redist-branch:
name: "Cleanup Redist Branch"
if: >
github.event.pull_request.head.repo.full_name == github.repository &&
startsWith(github.event.pull_request.head.ref, 'redist-update/')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Lock PR conversation
run: |
PR_NUMBER="${{ github.event.pull_request.number }}"
echo "Locking PR #$PR_NUMBER to prevent further comments"
gh pr lock "$PR_NUMBER" --repo "${{ github.repository }}" --reason resolved
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete PR branch
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
echo "Deleting redist PR branch: $BRANCH_NAME"
gh api \
-X DELETE \
"repos/${{ github.repository }}/git/refs/heads/$BRANCH_NAME"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}