Skip to content

Commit ff4b771

Browse files
committed
Updated checkout process.
1 parent c833942 commit ff4b771

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@ jobs:
88
publish:
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Get release branch
12+
id: get_branch
13+
run: |
14+
RELEASE_BRANCH=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
15+
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}" \
16+
| jq -r .target_commitish)
17+
echo "branch=$RELEASE_BRANCH" >> $GITHUB_OUTPUT
18+
1119
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
ref: ${{ steps.get_branch.outputs.branch }}
1223

1324
- name: Setup Node.js
1425
uses: actions/setup-node@v4
@@ -25,7 +36,7 @@ jobs:
2536
git config --local user.email "github-actions[bot]@users.noreply.github.com"
2637
git config --local user.name "github-actions[bot]"
2738
git commit -am "chore: update package version to $RELEASE_VERSION [skip ci]"
28-
git push
39+
git push origin ${{ steps.get_branch.outputs.branch }}
2940
fi
3041
3142
- name: Install dependencies

0 commit comments

Comments
 (0)