Skip to content

ci: enhance CI workflow to support commenting on forked PRs #281

ci: enhance CI workflow to support commenting on forked PRs

ci: enhance CI workflow to support commenting on forked PRs #281

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize]
push:
jobs:
build_test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test
- name: Report Compressed Size
id: compressed-size
uses: ./
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: index.js
- name: Save comment body
env:
COMMENT_BODY: ${{ steps.compressed-size.outputs.comment-body }}
run: printf '%s\n' "$COMMENT_BODY" > ./comment-body
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: comment-body
path: ./comment-body
retention-days: 1
- name: Save PR number
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}
run: echo "$PULL_REQUEST_NUMBER" > ./pr-number
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-number
path: ./pr-number
retention-days: 1