From 9cb6a2b614c01e83611d704501d9a3ba5af7b8a3 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 17 Mar 2021 08:11:37 -0700 Subject: [PATCH] [Tests] ensure `doctoc` action fails when it should --- .github/workflows/lint.yml | 8 ++------ package.json | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 26c7e88b5b..67d32ee112 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,14 +28,10 @@ jobs: steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main - name: 'npm install && npm run dockerfile_lint' + name: 'npm install && npm run doctoc' with: node-version: 'lts/*' - shell-command: | - set -e - cp README.md README.md.orig - npm run doctoc - diff -q README.md README.md.orig + command: "doctoc:check" test_naming: runs-on: ubuntu-latest diff --git a/package.json b/package.json index f520f7e255..09834e4a6b 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,9 @@ "test/installation/iojs": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_iojs test-$shell", "test/sourcing": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=sourcing test-$shell", "doctoc": "doctoc --title='## Table of Contents' --github README.md", + "predoctoc:check": "cp README.md v-README.md.orig && npm run doctoc", + "doctoc:check": "diff -q README.md v-README.md.orig", + "postdoctoc:check": "mv v-README.md.orig README.md", "eclint": "eclint check $(git ls-tree --name-only HEAD | xargs)", "dockerfile_lint": "dockerfile_lint" },