Fix SCSS scoped package imports #3729
Workflow file for this run
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 preview & run ecosystem tests | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| update_snapshots: | |
| description: Regenerate ecosystem snapshots and upload as artifact | |
| type: boolean | |
| default: false | |
| pull_request: | |
| push: | |
| branches: | |
| - '**' | |
| tags: | |
| - '!**' | |
| permissions: | |
| issues: write | |
| jobs: | |
| publish: | |
| name: Build and publish Knip | |
| runs-on: ubuntu-latest | |
| outputs: | |
| sha: ${{ steps.publish.outputs.sha }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: pnpm/action-setup@v5 | |
| - run: pnpm install --frozen-lockfile | |
| working-directory: packages/knip | |
| - run: pnpm run build | |
| working-directory: packages/knip | |
| - id: publish | |
| run: | | |
| pnpx pkg-pr-new publish --compact './packages/knip' './packages/language-server' './packages/mcp-server' | |
| - name: Comment on referenced issues | |
| if: github.event_name == 'push' | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const sha = '${{ steps.publish.outputs.sha }}'; | |
| const commits = context.payload.commits || []; | |
| const messages = commits.map(commit => commit.message).join('\n'); | |
| const issueRefs = messages.match(/#(\d+)/g) || []; | |
| const issues = new Set(issueRefs.map(ref => parseInt(ref.slice(1)))); | |
| const isClosingMatch = /(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s+#(\d+)/gi; | |
| const closingIssues = new Set([...messages.matchAll(isClosingMatch)].map(m => parseInt(m[1]))); | |
| for (const issue_number of issues) { | |
| try { | |
| const { owner, repo } = context.repo; | |
| const { data } = await github.rest.issues.get({ owner, repo, issue_number }); | |
| if (data.state === 'open' || closingIssues.has(issue_number)) { | |
| const body = `Preview release available:\n\`\`\`sh\nnpm i -D https://pkg.pr.new/knip@${sha}\n\`\`\``; | |
| await github.rest.issues.createComment({ owner, repo, issue_number, body }); | |
| } | |
| } catch(error) { | |
| console.log(`Could not comment on #${issue_number}: ${error.message}`);} | |
| } | |
| integration: | |
| name: Run Knip in ${{ matrix.project.name }} | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| env: | |
| PKG_URL: https://pkg.pr.new/knip@${{ needs.publish.outputs.sha }} | |
| SNAP: ${{ github.workspace }}/.github/workflows/scripts/snap.sh | |
| UPDATE_SNAPSHOTS: ${{ inputs.update_snapshots && '1' || '' }} | |
| SNAPSHOT_OUT_DIR: /tmp/snapshot-updates | |
| PNPM_CONFIG_MINIMUM_RELEASE_AGE: '0' | |
| PNPM_CONFIG_TRUST_POLICY: 'off' | |
| PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN: 'false' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: | |
| - name: 10ten-ja-reader | |
| repo: birchill/10ten-ja-reader | |
| commands: | | |
| pnpm install | |
| bash $SNAP 10ten-ja-reader -- pnpm dlx $PKG_URL | |
| - name: argos | |
| repo: argos-ci/argos | |
| commands: | | |
| pnpm install | |
| pnpm build | |
| pnpm add -D -w $PKG_URL | |
| bash $SNAP argos -- pnpm run knip | |
| - name: astro | |
| repo: withastro/astro | |
| commands: | | |
| pnpm install | |
| pnpm add -D -w $PKG_URL | |
| bash $SNAP astro -- pnpm knip --fix --exclude unresolved | |
| - name: create-typescript-app | |
| repo: JoshuaKGoldberg/create-typescript-app | |
| commands: | | |
| pnpm install | |
| pnpm add -D $PKG_URL | |
| bash $SNAP create-typescript-app -- pnpm lint:knip | |
| - name: DefinitelyTyped-tools | |
| repo: microsoft/DefinitelyTyped-tools | |
| commands: | | |
| pnpm install | |
| bash $SNAP DefinitelyTyped-tools -- pnpm dlx $PKG_URL | |
| - name: eslint | |
| repo: eslint/eslint | |
| commands: | | |
| npm install | |
| npm install --prefix docs | |
| npm install -D $PKG_URL | |
| bash $SNAP eslint -- npm run lint:unused -- --cache | |
| npm run lint:unused -- --cache --no-exit-code | |
| - name: mocha | |
| repo: mochajs/mocha | |
| commands: | | |
| npm ci | |
| npm install -D $PKG_URL | |
| bash $SNAP mocha -- npm run lint:knip | |
| - name: InvokeAI | |
| repo: invoke-ai/InvokeAI | |
| sparse-checkout: invokeai/frontend/web | |
| commands: | | |
| cd invokeai/frontend/web | |
| pnpm install | |
| pnpm add -D $PKG_URL | |
| bash $SNAP InvokeAI -- bunx --bun knip --tags=-knipignore | |
| bunx --bun knip --tags=-knipignore --production --fix --allow-remove-files --format --no-exit-code | |
| bash $SNAP InvokeAI-prod -- bunx --bun knip --tags=-knipignore --production | |
| - name: npmx.dev | |
| repo: npmx-dev/npmx.dev | |
| commands: | | |
| pnpm install | |
| pnpm add -D -w $PKG_URL | |
| bash $SNAP npmx.dev -- pnpm knip | |
| bash $SNAP npmx.dev-prod -- pnpm knip --production --exclude dependencies --fix | |
| - name: prettier | |
| repo: prettier/prettier | |
| commands: | | |
| yarn | |
| yarn --cwd scripts/release | |
| yarn --cwd scripts/tools/bundle-test | |
| yarn --cwd scripts/tools/eslint-plugin-prettier-internal-rules | |
| yarn --cwd website | |
| yarn add -D knip@$PKG_URL | |
| bash $SNAP prettier -- yarn knip | |
| - name: query | |
| repo: TanStack/query | |
| commands: | | |
| pnpm install | |
| pnpm add -D -w $PKG_URL | |
| bash $SNAP query -- pnpm test:knip --cache | |
| pnpm test:knip --cache --no-exit-code | |
| - name: rolldown | |
| repo: rolldown/rolldown | |
| commands: | | |
| pnpm install | |
| pnpm add -D -w knip@$PKG_URL | |
| bash $SNAP rolldown -- pnpm knip | |
| - name: sanity | |
| repo: sanity-io/sanity | |
| commands: | | |
| pnpm install --no-frozen-lockfile | |
| pnpm add -D -w $PKG_URL | |
| bash $SNAP sanity -- pnpm knip --exclude duplicates | |
| - name: sentry | |
| repo: getsentry/sentry | |
| commands: | | |
| pnpm install | |
| pnpm add -D $PKG_URL | |
| bash $SNAP sentry -- pnpm run knip --fix | |
| bash $SNAP sentry-prod -- pnpm run knip:prod | |
| - name: slonik | |
| repo: gajus/slonik | |
| commands: | | |
| pnpm install --no-frozen-lockfile --ignore-scripts | |
| bash $SNAP slonik -- pnpm dlx $PKG_URL | |
| - name: TypeScript | |
| repo: microsoft/TypeScript | |
| commands: | | |
| npm ci | |
| npm install -D $PKG_URL | |
| npx hereby generate-diagnostics | |
| bash $SNAP TypeScript -- npx knip | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check out ${{ matrix.project.repo }} | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ matrix.project.repo }} | |
| path: ${{ matrix.project.name }} | |
| sparse-checkout: ${{ matrix.project.sparse-checkout }} | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| - uses: pnpm/action-setup@v5 | |
| - name: Run Knip in ${{ matrix.project.repo }} | |
| working-directory: ${{ matrix.project.name }} | |
| run: | | |
| set -x | |
| ${{ matrix.project.commands }} | |
| - name: Upload updated snapshots | |
| if: ${{ inputs.update_snapshots }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: snapshots-${{ matrix.project.name }} | |
| path: /tmp/snapshot-updates/ | |
| if-no-files-found: ignore | |
| aggregate-snapshots: | |
| name: Aggregate updated snapshots | |
| if: ${{ inputs.update_snapshots }} | |
| needs: integration | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: snapshots-* | |
| path: snapshots/ | |
| merge-multiple: true | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: snapshots | |
| path: snapshots/ |