chore: release main #187
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: Regenerate NOTICE.txt | |
| # Runs on any PR that updates package.json / package-lock.json (human or bot) | |
| # and on direct pushes to main, so NOTICE.txt is always kept in sync with the | |
| # dependency tree and the notice-file CI check never fails spuriously. | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths: | |
| - package.json | |
| - package-lock.json | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - package.json | |
| - package-lock.json | |
| permissions: {} | |
| jobs: | |
| regenerate: | |
| runs-on: ubuntu-latest | |
| # Skip fork PRs — GITHUB_TOKEN can't push to a fork's branch. | |
| if: > | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| # For PRs, check out the head branch so we can push back to it. | |
| # For pushes to main, this defaults to the pushed commit. | |
| ref: ${{ github.head_ref || github.ref }} | |
| token: ${{ github.token }} | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | |
| with: | |
| node-version: 24.x | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Regenerate NOTICE.txt | |
| run: node scripts/generate-notice.mjs | |
| - name: Commit if changed | |
| run: | | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| if git diff --quiet NOTICE.txt; then | |
| echo "NOTICE.txt is already up to date." | |
| else | |
| git add NOTICE.txt | |
| git commit -m "chore: regenerate NOTICE.txt" | |
| git push | |
| fi |