Skip to content

Commit 230664a

Browse files
committed
fix(ci): harden release workflow publish and notes
1 parent 75f4771 commit 230664a

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,26 @@ jobs:
118118
echo "EOF"
119119
} >>"$GITHUB_OUTPUT"
120120
121+
- name: Setup Node
122+
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
123+
uses: actions/setup-node@v4
124+
with:
125+
node-version: 22
126+
registry-url: https://registry.npmjs.org
127+
128+
- name: Publish to npm
129+
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
130+
run: npm publish --access public --provenance
131+
121132
- name: Create GitHub release
122133
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
123134
run: |
135+
NOTES_FILE=$(mktemp)
136+
cat >"$NOTES_FILE" <<'EOF'
137+
${{ steps.release_notes.outputs.body }}
138+
EOF
124139
gh release create "v${{ steps.determine.outputs.current_version }}" \
125140
--title "v${{ steps.determine.outputs.current_version }}" \
126-
--notes "${{ steps.release_notes.outputs.body }}"
141+
--notes-file "$NOTES_FILE"
127142
env:
128143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129-
130-
- name: Publish to npm
131-
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
132-
run: npm publish --access public --provenance

0 commit comments

Comments
 (0)