ci: fix (#20155) #319
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to pkg.pr.new | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| tags: ["!**"] | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| publish: | |
| if: | | |
| github.repository == 'webpack/webpack' && | |
| (github.event_name != 'pull_request' || | |
| github.event.pull_request.head.repo.full_name == github.repository) | |
| name: Publish to pkg.pr.new | |
| runs-on: ubuntu-latest | |
| outputs: | |
| sha: ${{ steps.publish.outputs.sha }} | |
| urls: ${{ steps.publish.outputs.urls }} | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - run: corepack enable | |
| - name: Use Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: lts/* | |
| cache: yarn | |
| - run: yarn --frozen-lockfile | |
| - run: npx pkg-pr-new publish --compact --json output.json --comment=off | |
| - name: Add metadata to output | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const { run } = await import('${{ github.workspace }}/.github/scripts/publish-to-pkg-pr-new.mjs'); | |
| await run({ github, context }); |