From 0e6cd78a509c50803e06b30592b1cbe0e044b110 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 29 Apr 2024 22:31:42 -0400 Subject: [PATCH] ci: update comment-release workflow --- .github/workflows/comment-release.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/comment-release.yml b/.github/workflows/comment-release.yml index 00b8ef9..3785f78 100644 --- a/.github/workflows/comment-release.yml +++ b/.github/workflows/comment-release.yml @@ -17,6 +17,11 @@ jobs: with: fetch-depth: 0 + - name: ⬇️ Checkout PR + run: | + git fetch origin pull/${{ github.event.issue.number }}/head:pr-find-commit + git checkout pr-find-commit + - name: Install pnpm uses: pnpm/action-setup@v3 with: @@ -50,13 +55,15 @@ jobs: const { issue: { number: issue_number }, repo: { owner, repo }, payload } = context; const { name: packageName, version } = require(`${process.env.GITHUB_WORKSPACE}/package.json`); + const body = [ + `npm package published to pre tag.`, + `\`\`\`bash\nnpm install ${packageName}@pre\n\`\`\`` + `\`\`\`bash\nnpm install ${packageName}@${version}\n\`\`\`` + ].join('\n\n'); + await github.rest.issues.updateComment({ owner, repo, comment_id: payload.comment.id, - body: [ - `npm package published to pre tag.`, - `\`\`\`bash\nnpm install ${packageName}@pre\n\`\`\`` - `\`\`\`bash\nnpm install ${packageName}@${version}\n\`\`\`` - ].join('\n\n'), + body, });