Skip to content

Commit e15e4d8

Browse files
committed
ci: skip branch check on dry-run
1 parent abed5f1 commit e15e4d8

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

.github/workflows/release-validated.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@ jobs:
5656
echo "Current branch: $BRANCH"
5757
echo "Release type: $TYPE"
5858
59-
# Branch validation
60-
if [ "$TYPE" == "patch" ] || [ "$TYPE" == "retag" ]; then
61-
if [[ ! $BRANCH =~ ^release/[0-9]+\.[0-9]+\._$ ]]; then
62-
echo "::error::${TYPE^} can only be performed from 'release/*' branches (format: release/X.Y._)"
63-
exit 1
64-
fi
65-
else
66-
if [ "$BRANCH" != "main" ]; then
67-
echo "::error::Major or minor releases can only be performed from 'main' branch"
68-
exit 1
59+
# Branch validation (skipped for dry-run to allow testing from any branch)
60+
if [ "${{ inputs.dry_run }}" != "true" ]; then
61+
if [ "$TYPE" == "patch" ] || [ "$TYPE" == "retag" ]; then
62+
if [[ ! $BRANCH =~ ^release/[0-9]+\.[0-9]+\._$ ]]; then
63+
echo "::error::${TYPE^} can only be performed from 'release/*' branches (format: release/X.Y._)"
64+
exit 1
65+
fi
66+
else
67+
if [ "$BRANCH" != "main" ]; then
68+
echo "::error::Major or minor releases can only be performed from 'main' branch"
69+
exit 1
70+
fi
6971
fi
7072
fi
7173

0 commit comments

Comments
 (0)