Skip to content

Commit

Permalink
Merge pull request #223 from catenax-ng/bugfix/cmp-1100/fix-swaggerhu…
Browse files Browse the repository at this point in the history
…b-workflow

Bugfix/cmp 1100/fix swaggerhub workflow: fixed release version issue
  • Loading branch information
saudkhan116 authored Jan 29, 2024
2 parents e772f58 + b34c3d2 commit 9fffe1b
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/publish-swagger-hub.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#################################################################################
# Catena-X - Product Passport Consumer Application
# Catena-X - Digital Product Passport Application
#
# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA
# Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA
# Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand Down Expand Up @@ -32,15 +33,13 @@ on:
inputs:
version:
required: false
default: 'main'
type: string

workflow_dispatch:
inputs:
version:
required: false
description: "Version of the DPP API is to be published"
default: 'main'
type: string

jobs:
Expand All @@ -49,6 +48,7 @@ jobs:
env:
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
SWAGGERHUB_USER: ${{ secrets.SWAGGERHUB_USER }}

steps:
- uses: actions/checkout@v4

Expand All @@ -60,10 +60,19 @@ jobs:
- name: Install Swagger CLI
run: |
npm i -g swaggerhub-cli
- name: Get version tag
id: version
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Extract versions
- name: Set version tag
run: |
export DOWNSTREAM_VERSION=${{ inputs.version }}
if [ -z ${{ inputs.version }} ]; then
export DOWNSTREAM_VERSION=${{ steps.version.outputs.tag }}
else
export DOWNSTREAM_VERSION=${{ inputs.version }}
fi
echo "[INFO] - DOWNSTREAM_VERSION=$DOWNSTREAM_VERSION" >> "$GITHUB_ENV"
- name: Create and Download API specs
Expand Down

0 comments on commit 9fffe1b

Please sign in to comment.