https://github.com/ghostdevv/svelte-check-action
run svelte-check on the files that change in a pull request and have the errors commented
https://github.com/ghostdevv/svelte-check-action
lint svelte svelte-check
Last synced: 4 months ago
JSON representation
run svelte-check on the files that change in a pull request and have the errors commented
- Host: GitHub
- URL: https://github.com/ghostdevv/svelte-check-action
- Owner: ghostdevv
- License: mit
- Created: 2024-07-09T22:00:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-21T20:33:56.000Z (6 months ago)
- Last Synced: 2025-03-17T07:11:23.253Z (4 months ago)
- Topics: lint, svelte, svelte-check
- Language: TypeScript
- Homepage:
- Size: 628 KB
- Stars: 14
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Svelte Check Action
This action runs [svelte-check](http://npmjs.com/svelte-check) on the files that change in a PR (by default), then adds a comment which reports any errors in those files. The inspiration came from wanting to have svelte-check run in CI without failing, so that we can progressively fix a codebase with a lot of issues.
Works with svelte-check version 3 & 4. The action runs using Node 20.
## Example
```yaml
name: Svelte Checkon:
- pull_requestjobs:
demo:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4# You can replace these steps with your specific setup steps
# This example assumes Node 22 and pnpm 8
- name: Setup Node 22
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/- name: Setup PNPM
uses: pnpm/[email protected]
with:
version: 8.12.1- name: Install
run: pnpm install# Run the svelte check action
- name: Svelte Check
uses: ghostdevv/svelte-check-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```This will add a comment to your PRs with any errors, for example:

## Options
| Option | Description | Default |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
| `paths` | The folder(s) to run svelte-check in, one per line. It'll only run svelte-check if files in that folder have changed. `svelte-kit sync` will be ran before diagnostics if SvelteKit is found at the folder package.json. | `.` |
| `filterChanges` | When true only the files that change (in the pull request) will be checked | `true` |
| `failOnError` | Should we cause CI to fail if there is a Svelte Check error? | `false` |
| `failOnWarning` | Should we cause CI to fail if there is a Svelte Check warning? | `false` |
| `failFilter` | When failFilter is set and either failOnError or failOnWarning is enabled, the action will only fail for issues that occur in paths matching these globes. | Disabled |You can configure the action by passing the options under the `with` key, for example:
```yaml
- name: Svelte Check
uses: ghostdevv/svelte-check-action@v1
with:
paths: |
./packages/app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```