Bot: Remove Temporary PR Branch #78
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-latest | |
if: > | |
github.event.workflow_run.event == 'pull_request' && | |
github.event.workflow_run.conclusion == 'success' | |
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 }} |