Skip to content

Commit 08d4af9

Browse files
committed
WIP
1 parent 27ecbf2 commit 08d4af9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/actions/build-proxies/action.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ inputs:
88
releaseVersion:
99
description: "Release, tag, branch, or commit ID to be used for deployment"
1010
required: true
11+
isRelease:
12+
description: "True if releaseVersion is a release tag (if set, downloads from release assets instead of workflow artifacts)"
13+
required: false
14+
default: false
1115
environment:
1216
description: "Deployment environment"
1317
required: true
@@ -30,12 +34,30 @@ runs:
3034
using: composite
3135

3236
steps:
33-
- name: Download OAS Spec artifact
37+
- name: Download OAS Spec artifact from workflow
38+
if: ${{ inputs.isRelease == 'false' }}
3439
uses: actions/download-artifact@v4
3540
with:
3641
name: api-oas-specification-${{ inputs.apimEnv }}${{ inputs.version != '' && format('-{0}', inputs.version) || '' }}
3742
path: ./build
3843

44+
- name: Download OAS Spec artifact from release
45+
if: ${{ inputs.isRelease == 'true' }}
46+
shell: bash
47+
run: |
48+
mkdir -p ./build
49+
ASSET_PATTERN="api-oas-specification-${{ inputs.apimEnv }}-*.zip"
50+
echo "Downloading assets matching $ASSET_PATTERN from release ${{ inputs.release }}"
51+
gh release download "${{ inputs.release }}" \
52+
--pattern "$ASSET_PATTERN" \
53+
--dir ./build
54+
# Unzip the downloaded file (there should be exactly one match)
55+
ASSET_FILE=$(ls ./build/api-oas-specification-${{ inputs.apimEnv }}-*.zip)
56+
unzip -o "$ASSET_FILE" -d ./build
57+
rm "$ASSET_FILE"
58+
env:
59+
GH_TOKEN: ${{ github.token }}
60+
3961
- name: Setup Proxy Name and target
4062
shell: bash
4163
run: |

0 commit comments

Comments
 (0)