Skip to content

Commit 7106934

Browse files
committed
chore(ci): update every package package.json
1 parent 9c62c1f commit 7106934

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
1921

2022
- name: Setup Node.js
2123
uses: actions/setup-node@v4
@@ -42,8 +44,12 @@ jobs:
4244
echo "list=$WORKSPACES" >> $GITHUB_OUTPUT
4345
echo "Workspaces: $WORKSPACES"
4446
45-
- name: Build all workspaces
46-
run: npm run build -ws --if-present
47+
- name: Switch to default branch and align with tag commit
48+
run: |
49+
DEFAULT_BRANCH="${{ github.event.repository.default_branch }}"
50+
git fetch origin "$DEFAULT_BRANCH"
51+
git checkout "$DEFAULT_BRANCH"
52+
git merge --ff-only "$GITHUB_SHA"
4753
4854
- name: Update package.json versions
4955
run: |
@@ -63,13 +69,16 @@ jobs:
6369
}
6470
"
6571
72+
- name: Build all workspaces
73+
run: npm run build -ws --if-present
74+
6675
- name: Commit changes
6776
run: |
6877
git config --local user.email "action@github.com"
6978
git config --local user.name "GitHub Action"
7079
git add packages/*/package.json
71-
git commit -m "chore: update package versions to ${{ steps.tag_version.outputs.version }}" || exit 0
72-
git push
80+
git commit -m "chore: update workspace versions to ${{ steps.tag_version.outputs.version }}" || exit 0
81+
git push origin HEAD
7382
7483
- name: Publish packages
7584
run: |

0 commit comments

Comments
 (0)