Skip to content

Commit

Permalink
refactor: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sbsrnt committed Mar 6, 2024
1 parent 535f6ba commit 02c5102
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/preview-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
});
echo "publish_output=$output" >> $GITHUB_OUTPUT # Use the new syntax to set the output

0 comments on commit 02c5102

Please sign in to comment.