Skip to content

refactor(api, db): team validation (#1123) #192

refactor(api, db): team validation (#1123)

refactor(api, db): team validation (#1123) #192

name: Delete spec version from SwaggerHub
defaults:
run:
working-directory: .
on:
push:
branches:
- master
- release/[0-9]+.[0-9]+.[0-9]+
jobs:
removespec:
name: Delete api from SwaggerHub
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.17.0'
- run: npm i --location=global swaggerhub-cli
- run: |
VERSION=`echo ${GITHUB_REF_NAME}| sed 's#[^a-zA-Z0-9_\.\-]#_#g'`
SWAGGERHUB_API_KEY=${{secrets.SWAGGERHUB_TOKEN}} swaggerhub api:unpublish "Moira/moira-alert/${VERSION}" || true
SWAGGERHUB_API_KEY=${{secrets.SWAGGERHUB_TOKEN}} swaggerhub api:delete "Moira/moira-alert/${VERSION}" || true
# The `|| true` at the end of the calls is necessary to keep the job from crashing
# when deleting documentation that hasn't been created yet, but if you see something wrong happening,
# remove `|| true` from the command