Skip to content

Commit a9468b2

Browse files
authored
Validate GIT_VERSION and RELEASE_CHANNEL inputs
Added input validation for GIT_VERSION and RELEASE_CHANNEL in the workflow. Signed-off-by: Aabid Sofi <[email protected]>
1 parent e9abd75 commit a9468b2

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.github/workflows/multi-platform.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,36 @@ on:
3737
type: string
3838

3939
env:
40-
GIT_VERSION: ${{github.event.inputs.release-ver}}
40+
GIT_VERSION: ${{github.event.inputs.release-ver || inputs.release-ver }}
4141
RELEASE_CHANNEL: ${{github.event.inputs.release-channel || inputs.release-channel }}
4242

4343
jobs:
44-
print-inputs:
44+
validate-inputs:
4545
runs-on: ubuntu-latest
4646
steps:
47-
- run: |
48-
echo "Env RELEASE_CHANNEL: ${{env.RELEASE_CHANNEL}}"
49-
echo "Env GIT_VERSION: ${{env.GIT_VERSION}}"
47+
- name: Validate inputs
48+
run: |
49+
echo "Validating GIT_VERSION and RELEASE_CHANNEL..."
50+
51+
if [ -z "${{ env.GIT_VERSION }}" ]; then
52+
echo "❌ Error: GIT_VERSION is empty!"
53+
exit 1
54+
fi
55+
56+
if [ -z "${{ env.RELEASE_CHANNEL }}" ]; then
57+
echo "❌ Error: RELEASE_CHANNEL is empty!"
58+
exit 1
59+
fi
60+
61+
echo "✓ Validation passed: GIT_VERSION=${{ env.GIT_VERSION }}, RELEASE_CHANNEL=${{ env.RELEASE_CHANNEL }}"
62+
5063
5164
docker-build:
5265
runs-on: ubuntu-latest
5366
steps:
5467
- name: Checkout repo
5568
uses: actions/checkout@v4
69+
5670
- name: Identify Release Values
5771
run: |
5872
GIT_VERSION="${{ env.GIT_VERSION }}"

0 commit comments

Comments
 (0)