Skip to content

Commit aa755e5

Browse files
authored
fix(workflow): fix auto-publish workflow script validation and execution (#43)
* fix(workflow): improve script validation in auto-publish workflow Replace unreliable yarn run --help script detection with direct Node.js package.json parsing - Use Node.js to directly read and validate package.json scripts instead of parsing yarn output - Improve error messages with detailed script information - Ensure reliable detection of required test:ci and dist scripts - Fix workflow failure when scripts exist but aren't detected by yarn run --help This resolves the "Missing test:ci script in package.json" error that occurred even when the scripts were properly defined in package.json. * fix(workflow): fix auto-publish workflow script validation and execution
1 parent c348b3e commit aa755e5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.github/workflows/auto-publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ jobs:
5050
echo "Branch name: $BRANCH_NAME"
5151
5252
# Simplified pattern that properly handles hyphens, underscores, and dots
53-
if [[ $BRANCH_NAME =~ ^(feat|feature|fix|bugfix|break|breaking|hotfix|chore)/[a-zA-Z0-9._-]+$ ]]; then
53+
if [[ "$BRANCH_NAME" =~ ^(feat|feature|fix|bugfix|break|breaking|hotfix|chore)/[a-zA-Z0-9._-]+$ ]]; then
5454
echo "✅ Branch pattern accepted: $BRANCH_NAME"
55-
echo "should_publish=true" >> $GITHUB_OUTPUT
56-
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
55+
echo "should_publish=true" >> "$GITHUB_OUTPUT"
56+
echo "branch_name=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
5757
else
5858
echo "❌ Branch '$BRANCH_NAME' doesn't match required patterns"
59-
echo "should_publish=false" >> $GITHUB_OUTPUT
60-
exit 0
59+
echo "should_publish=false" >> "$GITHUB_OUTPUT"
6160
fi
6261
6362
- name: Install dependencies

0 commit comments

Comments
 (0)