-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add job to delete published APIs on swaggerhub
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: Huawei Inc. | ||
# | ||
--- | ||
name: upload-to-swagger-hub-only | ||
# This job deletes API that is already published on swaggerhub. | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
VersionToBeDeleted: | ||
type: string | ||
description: Enter the version of the API that must be deleted.Eg., 1.0.1 | ||
|
||
env: | ||
BOT_USER_NAME: eclipse-xpanse-bot | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
upload-to-swagger-hub: | ||
runs-on: ubuntu-latest | ||
env: | ||
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }} | ||
SWAGGERHUB_USER: ${{ secrets.SWAGGERHUB_USER }} | ||
if: github.repository == 'eclipse-xpanse/xpanse' | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Install SwaggerHub CLI | ||
run: npm i -g swaggerhub-cli | ||
|
||
- name: Unpublish API | ||
run: swaggerhub api:unpublish ${{ env.SWAGGERHUB_USER }}/XpanseRuntimeApi/v${{github.event.inputs.VersionToBeDeleted}} | ||
continue-on-error: true | ||
|
||
- name: Delete provided API version | ||
run: swaggerhub api:delete ${{ env.SWAGGERHUB_USER }}/XpanseRuntimeApi/v${{github.event.inputs.VersionToBeDeleted}} --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters