diff --git a/.github/workflows/preview-publish.yml b/.github/workflows/preview-publish.yml index 342aa58..32690ec 100644 --- a/.github/workflows/preview-publish.yml +++ b/.github/workflows/preview-publish.yml @@ -39,6 +39,19 @@ jobs: - name: Build run: npm run build + - name: Comment PR with Published Versions + uses: actions/github-script@v7 + with: + script: | + const output = `${{ steps.lerna_publish.outputs.publish_output }}`; + const prNumber = context.payload.pull_request.number; + const comment = `Published Packages:\n\`\`\`\n${output}\n\`\`\``; + github.rest.issues.createComment({ + ...context.repo, + issue_number: prNumber, + body: comment + }); + - name: Lerna publish prerelease id: lerna_publish env: @@ -47,19 +60,4 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | output=$(npx lerna version prerelease --preid preview --yes --no-push && npx lerna publish from-git --dist-tag next --yes) - echo "publish_output=$output" >> $GITHUB_OUTPUT # Use the new syntax to set the output - - comment-pr: - if: steps.lerna_publish.outcome == 'success' - name: Comment PR with Published Versions - uses: actions/github-script@v7 - with: - script: | - const output = `${{ steps.lerna_publish.outputs.publish_output }}`; - const prNumber = context.payload.pull_request.number; - const comment = `Published Packages:\n\`\`\`\n${output}\n\`\`\``; - github.rest.issues.createComment({ - ...context.repo, - issue_number: prNumber, - body: comment - }); \ No newline at end of file + echo "publish_output=$output" >> $GITHUB_OUTPUT # Use the new syntax to set the output \ No newline at end of file