File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 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
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 : |
You can’t perform that action at this time.
0 commit comments