-
Notifications
You must be signed in to change notification settings - Fork 9
36 lines (31 loc) · 1.04 KB
/
pr-closed.yaml
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
33
34
35
36
name: PR Closed
on:
pull_request:
types:
- closed
env:
GITHUB_API_URL_BASE: https://api.github.com/repos/${{ github.repository }}
TAG_NAME: release-pr-${{ github.event.pull_request.number }}
jobs:
delete-release-tag:
runs-on: [self-hosted, linux, x64]
steps:
- name: Check tag ref exist
id: check-tag-ref
# https://docs.github.com/en/free-pro-team@latest/rest/reference/git#get-a-reference
run: |
curl --url $GITHUB_API_URL_BASE/git/refs/tags/$TAG_NAME \
-sI \
-o /dev/null \
-w "%{http_code}" \
-H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \
> status
echo "::set-output name=status::$(cat status)"
- name: Delete release tag of this pull request
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: ${{ env.TAG_NAME }}
repo: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}