Skip to content

doc: Update Remote config section in checker.example.yml #116

doc: Update Remote config section in checker.example.yml

doc: Update Remote config section in checker.example.yml #116

name: Delete spec version from SwaggerHub
defaults:
run:
working-directory: openapi
on:
pull_request:
types: [closed]
delete:
branches:
- master
- v[0-9]+.[0-9]+.[0-9]+
- feature/*
jobs:
removespec:
name: Remove the corresponding spec from SwaggerHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Extract branch name on branch delete
if: github.event_name != 'pull_request'
id: extract_branch_name
run: echo "::set-env name=BRANCH_NAME::$(echo ${{ github.event.ref }})"
- name: Extract branch name on PR closed or merged
if: github.event_name == 'pull_request'
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})"
- name: remove spec from swaggerhub
env:
AUTH_TOKEN: ${{secrets.SWAGGERHUB_TOKEN}}
SWAGGERHUB_URL: "https://api.swaggerhub.com/apis/Moira/moira-alert"
shell: bash
run: |
VERSION=`echo ${BRANCH_NAME}|sed 's#[^a-zA-Z0-9_\.\-]#_#g'`
curl -X DELETE "${SWAGGERHUB_URL}/${VERSION}" -H "content-type: application/yaml" -H "Authorization: ${AUTH_TOKEN}"