diff --git a/.github/workflows/create-release-candidate.yml b/.github/workflows/create-release-candidate.yml index c002e31..a6cba8c 100644 --- a/.github/workflows/create-release-candidate.yml +++ b/.github/workflows/create-release-candidate.yml @@ -17,10 +17,13 @@ jobs: - uses: benjlevesque/short-sha@v3.0 id: short-sha - name: Log details + env: + BRANCH: ${{ github.event.pull_request.head.ref }} + SHA: ${{ github.event.pull_request.head.sha }} run: | echo "Commit Short SHA: ${{ steps.short-sha.outputs.sha }}" - echo "Commit SHA: ${{ github.event.pull_request.head.sha }}" - echo "Branch: ${{ github.event.pull_request.head.ref }}" + echo "Commit SHA: ${{ env.SHA }}" + echo "Branch: ${{ env.BRANCH }}" - name: Setup Node ⚙️ uses: ./.github/actions/setup-node with: @@ -29,12 +32,16 @@ jobs: run: npm run build && find dist/index.js - name: Normalize npm tag id: npm + env: + BRANCH: ${{ github.event.pull_request.head.ref }} run: | - npm_tag=$(echo ${{ github.event.pull_request.head.ref }} | sed 's/\//-/g') + npm_tag=$(echo ${{ env.BRANCH }} | sed 's/\//-/g') echo "NPM Tag: $npm_tag" echo "tag=$npm_tag" >> "$GITHUB_OUTPUT" - name: Update library version - run: npm version --allow-same-version --no-git-tag-version prerelease --preid=rc.${{ github.event.pull_request.head.sha }} + env: + SHA: ${{ github.event.pull_request.head.sha }} + run: npm version --allow-same-version --no-git-tag-version prerelease --preid=rc.${{ env.SHA }} - name: get-npm-version id: package-version uses: martinbeentjes/npm-get-version-action@v1.3.1 @@ -48,6 +55,9 @@ jobs: utc=$(date -u +"%b %-d, %Y at %-I:%M%p (UTC)") echo "utc=$utc" >> "$GITHUB_OUTPUT" - uses: marocchino/sticky-pull-request-comment@v2 + env: + BRANCH: ${{ github.event.pull_request.head.ref }} + SHA: ${{ github.event.pull_request.head.sha }} with: header: message: | @@ -55,7 +65,7 @@ jobs: 📘 Name | 🔑 Latest Commit | 📦 NPM | 🕒 Updated --- | --- | ---| --- - [typescript-library-template-example](https://github.com/AlbertHernandez/typescript-library-template/tree/${{ github.event.pull_request.head.ref }}) | [${{ steps.short-sha.outputs.sha }}](https://github.com/AlbertHernandez/typescript-library-template/commit/${{ github.event.pull_request.head.sha }}) | [NPM](https://www.npmjs.com/package/typescript-library-template-example/v/${{ steps.npm.outputs.tag }}) | ${{ steps.date.outputs.utc }} + [typescript-library-template-example](https://github.com/AlbertHernandez/typescript-library-template/tree/${{ env.BRANCH }}) | [${{ steps.short-sha.outputs.sha }}](https://github.com/AlbertHernandez/typescript-library-template/commit/${{ env.SHA }}) | [NPM](https://www.npmjs.com/package/typescript-library-template-example/v/${{ steps.npm.outputs.tag }}) | ${{ steps.date.outputs.utc }} ### 💻 Client installation