|
1 | 1 | --- |
2 | | - ########################### |
3 | | - ########################### |
4 | | - ## Pull request testing ## |
5 | | - ########################### |
6 | | - ########################### |
7 | 2 | name: Validate pull request |
8 | 3 |
|
9 | | - # Documentation: |
10 | | - # - Workflow: https://help.github.com/en/articles/workflow-syntax-for-github-actions |
11 | | - # - SuperLinter: https://github.com/github/super-linter |
12 | | - # - Link validation: https://github.com/remarkjs/remark-validate-links |
13 | | - |
14 | | - ###################################################### |
15 | | - # Start the job on a pull request to the main branch # |
16 | | - ###################################################### |
17 | 4 | on: pull_request |
18 | 5 |
|
19 | | - ################################################# |
20 | | - # Disable all permissions on the workflow level # |
21 | | - ################################################# |
22 | | - permissions: {} |
| 6 | + permissions: |
| 7 | + contents: read |
| 8 | + statuses: write |
23 | 9 |
|
24 | | - ############### |
25 | | - # Set the Job # |
26 | | - ############### |
27 | 10 | jobs: |
28 | | - lint: |
29 | | - # Set the agent to run on |
30 | | - runs-on: ubuntu-latest |
31 | | - |
32 | | - ############################################ |
33 | | - # Grant status permission for MULTI_STATUS # |
34 | | - ############################################ |
35 | | - permissions: |
36 | | - contents: read |
37 | | - statuses: write |
38 | | - |
39 | | - ################## |
40 | | - # Load all steps # |
41 | | - ################## |
42 | | - steps: |
43 | | - ########################## |
44 | | - # Checkout the code base # |
45 | | - ########################## |
46 | | - - name: Checkout Code |
47 | | - uses: actions/checkout@v4 |
48 | | - with: |
49 | | - # Full git history is needed to get a proper list of changed files |
50 | | - # within `super-linter` |
51 | | - fetch-depth: 0 |
52 | | - - name: Load super-linter configuration |
53 | | - run: cat .github/super-linter.env >> "$GITHUB_ENV" |
54 | | - |
55 | | - ################################ |
56 | | - # Run Linters against code base # |
57 | | - ################################ |
58 | | - - name: Lint Code Base |
59 | | - # |
60 | | - # Use full version number to avoid cases when a next |
61 | | - # released version is buggy |
62 | | - # About slim image: https://github.com/github/super-linter#slim-image |
63 | | - uses: super-linter/super-linter/[email protected] |
64 | | - env: |
65 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
66 | | - |
67 | | - test: |
68 | | - runs-on: ubuntu-latest |
69 | | - needs: lint |
70 | | - permissions: |
71 | | - contents: read |
72 | | - statuses: write |
73 | | - steps: |
74 | | - - uses: actions/checkout@v4 |
75 | | - - name: Use Setup Node and Install Dependencies Action |
76 | | - uses: commerce-docs/devsite-install-action@main |
77 | | - with: |
78 | | - node-version-file: '.nvmrc' |
79 | | - cache-dependency-path: 'yarn.lock' |
80 | | - |
81 | | - - name: Check links |
82 | | - run: yarn test |
83 | | - |
84 | | - build: |
85 | | - runs-on: ubuntu-latest |
86 | | - needs: test |
87 | | - permissions: |
88 | | - contents: read |
89 | | - statuses: write |
90 | | - steps: |
91 | | - - uses: actions/checkout@v4 |
92 | | - - name: Use Setup Node and Install Dependencies Action |
93 | | - uses: commerce-docs/devsite-install-action@main |
94 | | - with: |
95 | | - node-version-file: '.nvmrc' |
96 | | - cache-dependency-path: 'yarn.lock' |
97 | | - |
98 | | - - name: Build site |
99 | | - run: yarn build |
| 11 | + testing: |
| 12 | + uses: ./.github/workflows/validate-pr_job.yml |
0 commit comments