Bot: Remove Temporary PR Branch #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Bot: Remove Temporary PR Branch" | |
on: | |
workflow_run: | |
workflows: ["Bot: Send Close Pull Request Signal"] | |
types: | |
- completed | |
jobs: | |
delete: | |
name: "Delete branch from Pull Request" | |
runs-on: ubuntu-22.04 | |
if: > | |
github.event.workflow_run.event == 'pull_request' && | |
github.event.workflow_run.conclusion == 'success' | |
permissions: | |
contents: write | |
steps: | |
- name: 'Download artifact' | |
uses: carpentries/actions/download-workflow-artifact@main | |
with: | |
run: ${{ github.event.workflow_run.id }} | |
name: pr | |
- name: "Get PR Number" | |
id: get-pr | |
run: | | |
unzip pr.zip | |
echo "NUM=$(<./NUM)" >> $GITHUB_OUTPUT | |
- name: 'Remove branch' | |
uses: carpentries/actions/remove-branch@main | |
with: | |
pr: ${{ steps.get-pr.outputs.NUM }} |