Add validation check for s3_dest_dir if pushing to download.memgraph.com

This commit is contained in:
Deda 2024-03-22 14:27:39 +01:00
parent 37f4082ee8
commit ce8200238f
2 changed files with 22 additions and 2 deletions

View File

@ -46,7 +46,7 @@ on:
s3_region:
type: string
description: "Region for the target S3 bucket."
default: ''
default: 'eu-west-1'
s3_dest_dir:
type: string
description: "Target dir path in S3 bucket."
@ -134,6 +134,16 @@ jobs:
needs: [package]
runs-on: ubuntu-latest
steps:
- name: Validate dest_dir
if: ${{ inputs.s3_bucket == 'download.memgraph.com' }}
run: |
if ! [[ "${{ inputs.s3_dest_dir }}" =~ memgraph/[0-9]\.[0-9]+\.[0-9]+$ ]]; then
echo -e "Error: ${{ inputs.s3_dest_dir }} is not a valid official format. When pushing to 'download.memgraph.com' the dest dir has to match format 'memgraph/X.Y.Z'!"
exit 1
else
echo -e "Passed: Dest dir ${{ inputs.s3_dest_dir }} has a valid official format."
fi
- name: Download artifacts
uses: actions/download-artifact@v4
with:

View File

@ -46,7 +46,7 @@ on:
s3_region:
type: string
description: "Region for the target S3 bucket."
default: ''
default: 'eu-west-1'
s3_dest_dir:
type: string
description: "Target dir path in S3 bucket."
@ -129,6 +129,16 @@ jobs:
needs: [package]
runs-on: ubuntu-latest
steps:
- name: Validate dest_dir
if: ${{ inputs.s3_bucket == 'download.memgraph.com' }}
run: |
if ! [[ "${{ inputs.s3_dest_dir }}" =~ memgraph/[0-9]\.[0-9]+\.[0-9]+$ ]]; then
echo -e "Error: ${{ inputs.s3_dest_dir }} is not a valid official format. When pushing to 'download.memgraph.com' the dest dir has to match format 'memgraph/X.Y.Z'!"
exit 1
else
echo -e "Passed: Dest dir ${{ inputs.s3_dest_dir }} has a valid official format."
fi
- name: Download artifacts
uses: actions/download-artifact@v4
with: