-
Notifications
You must be signed in to change notification settings - Fork 30
28 lines (24 loc) · 1 KB
/
WasmCatDelete.yml
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
name: Wasm Delete Destination Branch
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#delete-event-delete
# delete event will only be triggered by default branch contains this action
on: delete
jobs:
delete:
runs-on: ubuntu-latest
# check again this is a delete branch event
if: github.event.ref_type == 'branch'
steps:
- name: Delete wasm-js-bindings branch
run: |
set -x
workspace=$(mktemp -d)
cd $workspace
git config --global user.email "wasmcat-bot@users.noreply.github.com"
git config --global user.name "wasmcat-bot"
# clone the main branch
git clone --depth 1 https://${{secrets.ACCESS_TOKEN}}@github.com/FindoraNetwork/wasm-js-bindings
cd wasm-js-bindings
# check target branch exists then we delete it
if git ls-remote --heads --exit-code origin ${{ github.event.ref }}; then
git push -d origin ${{ github.event.ref }}
fi