Skip to content

Commit

Permalink
refactor: separate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sbsrnt committed Mar 6, 2024
1 parent f2d5948 commit 535f6ba
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/preview-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ jobs:
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
- 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
});
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
});

0 comments on commit 535f6ba

Please sign in to comment.