Skip to content

Commit d990389

Browse files
Himani Anil Deshpandehimani2411
authored andcommitted
[GH] Add validation for input of pcluster-version
1 parent 042c7aa commit d990389

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/bump_version.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
pull-requests: write
2222
runs-on: ubuntu-latest
2323
steps:
24+
- name: Validate pcluster version format
25+
run: |
26+
if ! echo "${{ inputs.pcluster-version }}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
27+
echo "Error: Invalid version format '${{ inputs.pcluster-version }}'. Expected format: X.Y.Z (e.g., 3.14.0)"
28+
exit 1
29+
fi
30+
echo "Version format validated: ${{ inputs.pcluster-version }}"
2431
- uses: actions/checkout@v2
2532
with:
2633
fetch-depth: 0

.github/workflows/bump_version_awsbatch_cli.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
pull-requests: write
2222
runs-on: ubuntu-latest
2323
steps:
24+
- name: Validate awsbatch-cli version format
25+
run: |
26+
if ! echo "${{ inputs.awsbatch-cli-version }}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
27+
echo "Error: Invalid version format '${{ inputs.awsbatch-cli-version }}'. Expected format: X.Y.Z (e.g., 3.14.0)"
28+
exit 1
29+
fi
30+
echo "Version format validated: ${{ inputs.awsbatch-cli-version }}"
2431
- uses: actions/checkout@v2
2532
with:
2633
fetch-depth: 0

0 commit comments

Comments
 (0)