-
-
Notifications
You must be signed in to change notification settings - Fork 517
32 lines (30 loc) · 870 Bytes
/
pr-post-remove-branch.yaml
File metadata and controls
32 lines (30 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 }}