Skip to content

Commit 88377ae

Browse files
committed
fix command
1 parent b0ad3c5 commit 88377ae

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

.github/workflows/check-docs.yml

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,41 @@ jobs:
2222
runs-on: ubuntu-latest
2323

2424
steps:
25-
- name: Checkout Repo
26-
uses: actions/checkout@v4
27-
with:
28-
# get all history for the diff
29-
fetch-depth: 0
30-
- name: Set up Node (20)
31-
uses: actions/setup-node@v4
32-
with:
33-
node-version: 22.10.0
34-
- name: Yarn install
35-
run: yarn
36-
- name: Run doc generation
37-
run: yarn docgen:all
38-
- name: Check for changes in common/api-review dir (fail if so)
39-
run: |
40-
if [[ -n "$(git status common/api-review --porcelain)" ]]; then
41-
echo "Unstaged changes detected in api-report(s):"
42-
git status -s
43-
echo "COMMAND_TO_RUN='yarn build'" >> $GITHUB_OUTPUT
44-
exit 1
45-
fi
46-
# Overwrite the command if there are also docs-devsite changes since
47-
# running yarn docgen:all will also run yarn build first.
48-
- name: Check for changes in docs-devsite dir (fail if so)
49-
run: |
50-
if [[ -n "$(git status docs-devsite --porcelain)" ]]; then
51-
echo "Unstaged changes detected in docs-devsite/:"
52-
git status -s
53-
echo "COMMAND_TO_RUN='yarn docgen:all'" >> $GITHUB_OUTPUT
54-
exit 1
55-
fi
56-
- name: Reference documentation needs to be updated. See message below.
57-
if: ${{ failure() }}
58-
run: echo "Changes in this PR affect the reference docs or API reports. Run \`$COMMAND_TO_RUN\` locally to regenerate the changed files and add them to this PR."
25+
- name: Checkout Repo
26+
uses: actions/checkout@v4
27+
with:
28+
# get all history for the diff
29+
fetch-depth: 0
30+
- name: Set up Node (20)
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: 22.10.0
34+
- name: Yarn install
35+
run: yarn
36+
- name: Run doc generation
37+
run: yarn docgen:all
38+
- name: Check for changes in common/api-review dir (fail if so)
39+
id: api-report-check
40+
run: |
41+
if [[ -n "$(git status common/api-review --porcelain)" ]]; then
42+
echo "Unstaged changes detected in api-report(s):"
43+
git status -s
44+
echo "command-to-run='yarn build'" >> $GITHUB_OUTPUT
45+
exit 1
46+
fi
47+
# Overwrite the command if there are also docs-devsite changes since
48+
# running yarn docgen:all will also run yarn build first.
49+
- name: Check for changes in docs-devsite dir (fail if so)
50+
id: docs-check
51+
run: |
52+
if [[ -n "$(git status docs-devsite --porcelain)" ]]; then
53+
echo "Unstaged changes detected in docs-devsite/:"
54+
git status -s
55+
echo "command-to-run='yarn docgen:all'" >> $GITHUB_OUTPUT
56+
exit 1
57+
fi
58+
- name: Reference documentation needs to be updated. See message below.
59+
if: ${{ failure() }}
60+
run: echo "Changes in this PR affect the reference docs or API reports. Run \`$COMMAND_TO_RUN\` locally to regenerate the changed files and add them to this PR."
61+
env:
62+
COMMAND_TO_RUN: ${{ steps.docs-check.outputs.command-to-run || steps.api-report-check.outputs.command-to-run }}

0 commit comments

Comments
 (0)