Skip to content

Commit 1830703

Browse files
authored
Merge pull request #47 from prisma/ops/cli-release-tag-api
2 parents b74f322 + cc8164c commit 1830703

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/publish-cli.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,19 @@ jobs:
270270
working-directory: .publish/cli
271271
run: npm publish --access public --tag latest --provenance
272272

273-
- name: Create and push release tag
273+
- name: Create release tag
274274
if: ${{ !inputs.dry_run }}
275275
env:
276-
GITHUB_TOKEN: ${{ github.token }}
276+
GH_TOKEN: ${{ github.token }}
277277
run: |
278278
VERSION='${{ steps.cli_version.outputs.version }}'
279279
TAG="cli-v${VERSION}"
280-
git tag "${TAG}"
281-
git -c http.https://github.com/.extraheader="AUTHORIZATION: bearer ${GITHUB_TOKEN}" push origin "refs/tags/${TAG}"
280+
SHA="$(git rev-parse HEAD)"
281+
gh api \
282+
--method POST \
283+
"repos/${GITHUB_REPOSITORY}/git/refs" \
284+
-f ref="refs/tags/${TAG}" \
285+
-f sha="${SHA}"
282286
283287
- name: Summarize release
284288
run: |
@@ -292,7 +296,7 @@ jobs:
292296
echo "- Dry run: \`${{ inputs.dry_run }}\`"
293297
if [ '${{ inputs.dry_run }}' = 'true' ]; then
294298
echo "- Publish: skipped"
295-
echo "- Tag/push: skipped"
299+
echo "- Tag creation: skipped"
296300
else
297301
echo "- npm package: \`@prisma/cli@${VERSION}\`"
298302
echo "- npm dist-tag: \`latest\`"

0 commit comments

Comments
 (0)