From 532da87b1aba9d69a66368d68c501d1b4021a925 Mon Sep 17 00:00:00 2001 From: Adam Lehechka <42357034+alehechka@users.noreply.github.com> Date: Mon, 10 Apr 2023 20:36:42 -0500 Subject: [PATCH] Check auto-generated docs for changes (#17) * new check-docs.yaml workflow * make check-docs.yaml a valid workflow * fix README --- .github/workflows/check-dist.yaml | 4 ++-- .github/workflows/check-docs.yaml | 33 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/check-docs.yaml diff --git a/.github/workflows/check-dist.yaml b/.github/workflows/check-dist.yaml index 298dfed..4247078 100644 --- a/.github/workflows/check-dist.yaml +++ b/.github/workflows/check-dist.yaml @@ -19,7 +19,7 @@ jobs: check-dist: runs-on: ubuntu-latest strategy: - fail-fast: true + fail-fast: false matrix: path: - 'determine-environment' @@ -28,7 +28,7 @@ jobs: - 'get-package-version' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set Node.js 16.x uses: actions/setup-node@v3 diff --git a/.github/workflows/check-docs.yaml b/.github/workflows/check-docs.yaml new file mode 100644 index 0000000..b4bdee6 --- /dev/null +++ b/.github/workflows/check-docs.yaml @@ -0,0 +1,33 @@ +name: Check generated docs + +on: + pull_request: + workflow_dispatch: + +jobs: + check-docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: npm + cache-dependency-path: package-lock.json + + - name: Install dependencies + run: npm install --prefer-offline --frozen-lockfile + + - name: Regenerate all READMEs + run: npm run docs + + - name: Compare the expected and actual READMEs + run: | + if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi