Configure the release to be triggered on workflow dispatch only

This commit is contained in:
Pavindu Lakshan 2025-04-18 13:36:13 +05:30
parent 0de291fc87
commit 10f87b881d
2 changed files with 18 additions and 3 deletions

View file

@ -25,6 +25,24 @@ GIT_TOKEN=$1
WORK_DIR=$2
VERSION_TYPE=$3 # possible values: major, minor, patch
Check if GIT_TOKEN is empty
if [ -z "$GIT_TOKEN" ]; then
echo "❌ Error: GIT_TOKEN is not set."
exit 1
fi
# Check if WORK_DIR is empty
if [ -z "$WORK_DIR" ]; then
echo "❌ Error: WORK_DIR is not set."
exit 1
fi
# Validate VERSION_TYPE
if [[ "$VERSION_TYPE" != "major" && "$VERSION_TYPE" != "minor" && "$VERSION_TYPE" != "patch" ]]; then
echo "❌ Error: VERSION_TYPE must be one of: major, minor, or patch."
exit 1
fi
BUILD_DIRECTORY="$WORK_DIR/build"
RELEASE_DIRECTORY="$BUILD_DIRECTORY/releases"

View file

@ -10,9 +10,6 @@
name: Release
on:
pull_request:
branches: [ main ]
types: [closed]
workflow_dispatch:
inputs:
version_type: