Skip to content

Commit 5266f83

Browse files
committed
(chore) Fix release CI job
1 parent 03b2f38 commit 5266f83

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

.github/workflows/node.js.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,15 @@ jobs:
142142
run: yarn install --immutable
143143

144144
- run: yarn turbo run build --color
145-
- name: 🚢 Publish
146-
run: yarn run ci:publish
145+
- name: 🚢 Publish to NPM
146+
run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public
147147
env:
148148
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
149+
150+
- name: 📤 Upload Artifacts
151+
uses: actions/upload-artifact@v4
152+
with:
153+
name: dist
154+
path: |
155+
dist
156+
overwrite: true

scripts/fix-commit-messages.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Function to standardize commit message
4+
standardize_commit() {
5+
local msg="$1"
6+
7+
# Convert to lowercase and remove parentheses
8+
msg=$(echo "$msg" | tr '[:upper:]' '[:lower:]' | sed 's/^(//;s/)$//')
9+
10+
# Standardize types
11+
msg=$(echo "$msg" | sed -E 's/^(ft|feature):/\1eat:/')
12+
msg=$(echo "$msg" | sed -E 's/^(bug|fix):/\1ix:/')
13+
14+
# Add space after colon if missing
15+
msg=$(echo "$msg" | sed 's/:/: /')
16+
17+
# Remove trailing period
18+
msg=$(echo "$msg" | sed 's/\.$//')
19+
20+
# Convert first word to present tense if it's a past tense verb
21+
msg=$(echo "$msg" | sed -E 's/^(feat|fix|docs|test|refactor): (added|fixed|updated|removed|changed|modified)/\1: add|fix|update|remove|change|modify/')
22+
23+
echo "$msg"
24+
}
25+
26+
# Get all commit hashes
27+
git log --pretty=format:"%H" | while read -r commit_hash; do
28+
# Get the commit message
29+
commit_msg=$(git log -1 --pretty=format:"%s" $commit_hash)
30+
31+
# Standardize the commit message
32+
new_msg=$(standardize_commit "$commit_msg")
33+
34+
# Update the commit message
35+
git filter-branch -f --msg-filter "if [ \$GIT_COMMIT = '$commit_hash' ]; then echo '$new_msg'; else cat; fi" HEAD^..HEAD
36+
done

0 commit comments

Comments
 (0)