How do I use scantodo in a GitHub Actions CI pipeline? #4
-
|
I want to block PRs that introduce new I tried running it in my workflow but I am not sure how to configure it to only fail on |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Great question! Here is a minimal GitHub Actions workflow: # .github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npx scantodo --types FIXMEThe key is If you ever need to run it in reporting mode without failing CI, add the |
Beta Was this translation helpful? Give feedback.
Great question! Here is a minimal GitHub Actions workflow:
The key is
--types FIXME— this tells scantodo to only scan forFIXMEcomments and ignoreTODO,HACK,NOTE, andXXX. Since scantodo exits with code1when it finds matches, the workflow step will fail automatically.If you ever need to run it in reporting mode without failing CI, add the
--no-failflag.