diff --git a/.github/workflows/forbid-todo.yml b/.github/workflows/forbid-todo.yml new file mode 100644 index 0000000000..3b14135e71 --- /dev/null +++ b/.github/workflows/forbid-todo.yml @@ -0,0 +1,15 @@ +name: Forbid TODO + +on: + pull_request: + types: [opened, synchronize, reopened] + merge_group: + branches: [main] + +jobs: + forbid-todo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Forbid TODO + run: ./scripts/forbid-todo.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df66cba4bf..c975db71b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,5 +72,3 @@ jobs: name: dumps path: ${{ env.VSCODE_CRASH_DIR }} if: failure() - - name: Forbid TODOs - run: ./scripts/forbid-todo.sh diff --git a/scripts/forbid-todo.sh b/scripts/forbid-todo.sh index 7a2220ef0b..80287b4f9b 100755 --- a/scripts/forbid-todo.sh +++ b/scripts/forbid-todo.sh @@ -4,7 +4,7 @@ set -euo pipefail # Find the string 'TODO' in all files tracked by git, excluding # this file -TODOS_FOUND=$(git grep --color=always -nw TODO -- ':!scripts/forbid-todo.sh' || true) +TODOS_FOUND=$(git grep --color=always -nw TODO -- ':!scripts/forbid-todo.sh' ':!.github/workflows/forbid-todo.yml' || true) if [ -n "$TODOS_FOUND" ]; then printf "\e[1;31mERROR: \e[0mTODOs found in codebase:\n"