Skip to content

Commit

Permalink
Use PR sha for npm package version
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-jerolimov committed Sep 27, 2024
1 parent 5d08d56 commit 1399e1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/release-pr-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
- name: Publish to npm
run: |
# bash
short_sha=${"${{ github.event.pull_request.head.sha }}"::7}
full_sha="${{ github.event.pull_request.head.sha }}"
short_sha="${full_sha::7}"
npm version "0.0.0-pr-${{ github.event.number }}-${short_sha}" --no-git-tag-version
npm publish --access=public --tag=latest-pr
env:
Expand All @@ -45,7 +46,8 @@ jobs:
with:
script: |
// js
short_sha = "${{ github.event.pull_request.head.sha }}".slice(0, 7)
full_sha = "${{ github.event.pull_request.head.sha }}"
short_sha = full_sha.slice(0, 7)
version = `0.0.0-pr-${{ github.event.number }}-${short_sha}`
github.rest.issues.createComment({
issue_number: context.issue.number,
Expand Down

0 comments on commit 1399e1e

Please sign in to comment.