ci: add purge branch workflow

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-01-03 16:03:08 +01:00
parent d24fac00f0
commit 636567d65a
2 changed files with 26 additions and 0 deletions

14
.github/workflows/purge-branch.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: Purge branch
on:
delete:
jobs:
purge:
name: Delete ref from versions API
uses: ./.github/workflows/versionsapi.yml
with:
command: rm
rm_all: true
dryrun: true
ref: ${{ github.event.ref }}

View File

@ -39,6 +39,11 @@ on:
required: false
default: false
type: boolean
dryrun:
description: --dryrun flag
required: false
default: false
type: boolean
workflow_call:
inputs:
command:
@ -69,6 +74,11 @@ on:
description: --all flag
required: false
type: boolean
dryrun:
description: --dryrun flag
required: false
default: false
type: boolean
outputs:
output:
description: Output of the command
@ -175,6 +185,7 @@ jobs:
add_latest=$([[ "${{ inputs.add_latest }}" == "true" ]] && echo "--latest" || echo "")
add_release=$([[ "${{ inputs.add_release }}" == "true" ]] && echo "--release" || echo "")
rm_all=$([[ "${{ inputs.rm_all }}" == "true" ]] && echo "--all" || echo "")
dryrun=$([[ "${{ inputs.dryrun }}" == "true" ]] && echo "--dryrun" || echo "")
# shellcheck disable=SC2086
out=$(
@ -185,6 +196,7 @@ jobs:
${add_latest} \
${add_release} \
${rm_all} \
${dryrun} \
--verbose
)
echo "$out"