Skip to content

chore: configure pkg.pr.new #2

chore: configure pkg.pr.new

chore: configure pkg.pr.new #2

Workflow file for this run

name: Publish to pkg.pr.new
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
- name: Install Packages
run: pnpm install
- name: Build
run: pnpm run build
- run: pnpx pkg-pr-new publish --comment=off --json output.json --compact --no-template
- name: Add metadata to output
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
output.number = context.issue.number;
output.event_name = context.eventName;
output.ref = context.ref;
fs.writeFileSync('output.json', JSON.stringify(output), 'utf8');
- name: Upload output
uses: actions/upload-artifact@v4
with:
name: output
path: ./output.json
- run: ls -R .