-
Notifications
You must be signed in to change notification settings - Fork 450
65 lines (53 loc) · 1.77 KB
/
pull-request.yaml
File metadata and controls
65 lines (53 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: PullRequestCI
env:
# Force the stdout and stderr streams to be unbuffered
PYTHONUNBUFFERED: 1
on: # yamllint disable-line rule:truthy
pull_request:
types:
- synchronize
- reopened
- opened
# Cancel the previous wf run in PRs.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
DocsCheck:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20' # Adjust Node.js version as needed
cache: 'yarn' # Cache yarn dependencies
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
id: build
continue-on-error: true
run: |
DOCUSAURUS_IGNORE_SSG_WARNINGS=true yarn build
echo "exit_code=$?" >> $GITHUB_OUTPUT
- name: Check for validation failures
if: success() || failure() # Run regardless of build success
run: |
FAILED=false
if [ -f ".frontmatter-validation-failed" ]; then
echo "::error::Frontmatter validation failed"
FAILED=true
fi
if [ -f ".floating-pages-validation-failed" ]; then
echo "::error::Floating pages validation failed"
FAILED=true
fi
# Check if build failed with non-validation error
if [ "${{ steps.build.outputs.exit_code }}" != "0" ] && [ "$FAILED" != "true" ]; then
echo "::error::Build failed with exit code ${{ steps.build.outputs.exit_code }}"
exit 1
fi
if [ "$FAILED" = true ]; then
exit 1
fi