Skip to content

Commit a0ac1e1

Browse files
committed
fix: checkout to new commit (publish.yml)
1 parent b9634ff commit a0ac1e1

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,9 @@ jobs:
9999
uses: actions/checkout@v4
100100
with:
101101
fetch-depth: 0
102-
ref: ${{ github.ref }}
102+
ref: ${{ needs.create-version-commit.outputs.commit_sha }}
103103
token: ${{ secrets.GITHUB_TOKEN }}
104104

105-
- name: Fetch latest commits
106-
run: |
107-
git fetch origin
108-
git pull origin ${{ github.ref_name }}
109-
110105
- name: Create and push tag
111106
run: |
112107
VERSION="${{ github.event.inputs.version }}"
@@ -118,7 +113,7 @@ jobs:
118113
publish-npm:
119114
name: Publish to NPM
120115
runs-on: ubuntu-latest
121-
needs: create-version-tag
116+
needs: [create-version-commit, create-version-tag]
122117
permissions:
123118
contents: write
124119
id-token: write
@@ -127,6 +122,7 @@ jobs:
127122
uses: actions/checkout@v4
128123
with:
129124
fetch-depth: 0
125+
ref: ${{ needs.create-version-commit.outputs.commit_sha }}
130126

131127
- name: Setup Node.js
132128
uses: actions/setup-node@v4
@@ -161,14 +157,15 @@ jobs:
161157
create-github-release:
162158
name: Create GitHub Release
163159
runs-on: ubuntu-latest
164-
needs: publish-npm
160+
needs: [create-version-commit, publish-npm]
165161
permissions:
166162
contents: write
167163
steps:
168164
- name: Checkout
169165
uses: actions/checkout@v4
170166
with:
171167
fetch-depth: 0
168+
ref: ${{ needs.create-version-commit.outputs.commit_sha }}
172169

173170
- name: Generate Release Notes
174171
id: release_notes

0 commit comments

Comments
 (0)