Skip to content

Commit

Permalink
fix: protect from repoonwer+reponame as an input.packageName
Browse files Browse the repository at this point in the history
  • Loading branch information
Bidon15 committed Nov 14, 2023
1 parent 60892e7 commit 4a35997
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/reusable_dockerfile_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ jobs:
# Set the default package name to the repository name
PACKAGE_NAME=$REPO_NAME
# If a user submitted package name that has the naming containing
# both the repository owner and repository name, we fail
# e.g: inputs.packageName = "celestiaorg/celestiaorg" is not allowed
if [[ ! "${{ inputs.packageName }}" == "${{ github.repository }}" ]]; then
echo "------------------------------------------------------------"
echo "ERROR: Package name not valid! => [ $PACKAGE_NAME} ]"
echo "Don't use the repository owner and repository name in the package name."
echo "------------------------------------------------------------"
exit 1
fi
# If there is a user submitted package name, use it
if [[ ! "${{ inputs.packageName }}" != "" ]]; then
PACKAGE_NAME=$(echo "${{ inputs.packageName }}" | tr '[:upper:]' '[:lower:]')
Expand Down

0 comments on commit 4a35997

Please sign in to comment.