Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #647

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

test #647

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/npm-previews-comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: npm-previews-comment

on:
workflow_run:
workflows: ['npm-previews']
types:
- completed

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/download-artifact@v4
with:
name: preview
run-id: ${{ github.event.workflow_run.id }}
- uses: actions/github-script@v7
with:
script: |
const { templates, packages } = require('./preview_json.json')

const message = `
### Test the changes in this PR
${Object.entries(templates).map(([name, url]) => `- [StackBlitz - ${name}](${url})`).join('\n')}

<details>
<summary><b>Install individual packages</b></summary>
<br />

${Object.entries(packages).map(([name, url]) => `<details><summary><code>${name}</code></summary><p>

```
pnpm add ${name}
```
</p></details>
`).join('\n\n')}
`

console.log(message)
console.log(JSON.stringify(context, null, 2))

# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: '👋 Thanks for reporting!'
# })
6 changes: 5 additions & 1 deletion .github/workflows/npm-previews.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ jobs:
env:
CI: true
name: mdsvex
- run: pnpx pkg-pr-new publish './packages/*'
- run: API_URL=https://pkg.pr.new pnpx pkg-pr-new@https://d61368b4.stackblitz-cr.pages.dev/stackblitz-labs/pkg.pr.new/pkg-pr-new@183 publish './packages/*' --comment=off --json=preview_json.json
- uses: actions/upload-artifact@v4
with:
path: preview_json.json
name: preview
1 change: 1 addition & 0 deletions test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi
Loading