Skip to content

Commit

Permalink
[VAN-127175] Sanitize artifact name for openapi postprocessed specifi…
Browse files Browse the repository at this point in the history
…cations.
  • Loading branch information
timur-malikov_GIDT committed Sep 25, 2024
1 parent b717e48 commit f5fc3c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/generate-python-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ name: Generate Python SDK
on:
workflow_call:
inputs:
version_postfix:
description: 'Additional version postfix for the SDK'
required: false
type: string
default: ''
python_sdk_pr_base_branch:
description: 'The base branch for the Python SDK PR'
required: true
type: string
default: 'main'

specs_artifact_name:
description: 'The name of the artifact containing the preprocessed specs'
required: true
type: string
version_postfix:
description: 'Additional version postfix for the SDK'
required: false
type: string
default: ''
env:
SPEC_DIR: ${{ github.workspace }}/specs_preprocessed
PYTHON_DIR: ${{ github.workspace }}/sdk-blueprints/python
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ jobs:
python3 -m pip install -r $PREPROCESSING_DIR/requirements.txt
python3 $PREPROCESSING_DIR/preprocessing.py $ORIG_SPEC_DIR $SPEC_DIR
- name: Sanitize artifact name
id: sanitize
run: |
specs_artifact_name=$(echo "processed-specs-${{ github.ref_name }}" | tr -d '\r\n' | tr '":<>|*?\\/' '_')
echo "specs_artifact_name=$specs_artifact_name" >> $GITHUB_ENV
- name: Upload preprocessed specifications as artifact
uses: actions/upload-artifact@v4
with:
name: processed-specs-${{ github.ref_name }}
name: ${{ env.specs_artifact_name }}
path: ${{ env.SPEC_DIR }}
retention-days: 7

Expand All @@ -46,8 +52,9 @@ jobs:
uses: ./.github/workflows/generate-python-sdk.yml
secrets: inherit
with:
version_postfix: ${{ github.event.inputs.version_postfix }}
python_sdk_pr_base_branch: ${{ vars.PYTHON_SDK_PR_BASE_BRANCH }}
specs_artifact_name: ${{ env.specs_artifact_name }}
version_postfix: ${{ github.event.inputs.version_postfix }}

create-and-merge-pr:
name: Create and Merge Pull Request for release
Expand Down

0 comments on commit f5fc3c5

Please sign in to comment.