hdoc-tools 0.18.2 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
name: HDocBuildPull
|
2
|
+
|
2
3
|
on:
|
3
4
|
# Triggers the workflow on pull request opened or reopened events
|
4
5
|
pull_request_target:
|
@@ -6,49 +7,11 @@ on:
|
|
6
7
|
paths-ignore:
|
7
8
|
- '.github/**'
|
8
9
|
|
9
|
-
|
10
10
|
jobs:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
ref: ${{ github.event.pull_request.head.sha }}
|
19
|
-
|
20
|
-
# Setup NodeJS LTS (18 currently)
|
21
|
-
- uses: actions/setup-node@v3
|
22
|
-
with:
|
23
|
-
node-version: 18
|
24
|
-
|
25
|
-
# Install hdoc-tools globally
|
26
|
-
- name: Install hdoc-tools
|
27
|
-
run: npm install hdoc-tools -g
|
28
|
-
|
29
|
-
# Run hdoc validate against checked-out content
|
30
|
-
- name: Perform Validation
|
31
|
-
id: hdocbuild
|
32
|
-
run: |
|
33
|
-
if result=`hdoc validate 2>&1`; then
|
34
|
-
printf "Build Success!\n\n"
|
35
|
-
printf "$result"
|
36
|
-
exit 0
|
37
|
-
else
|
38
|
-
valout=$(echo "$result" | awk '/Validation Output/,0')
|
39
|
-
printf "Build Failed!\n\n-----------------------\n"
|
40
|
-
printf "$valout"
|
41
|
-
exit 1
|
42
|
-
fi
|
43
|
-
|
44
|
-
# If build validation fails, and event trigger was a pull request then close the pull request
|
45
|
-
- name: Reject Pull Request
|
46
|
-
if: failure()
|
47
|
-
uses: superbrothers/close-pull-request@v3
|
48
|
-
with:
|
49
|
-
comment: "Your pull request has been rejected as build validation has failed. See the Perform Validation step of the build job for more information: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
50
|
-
|
51
|
-
# If build validation is successful, echo message
|
52
|
-
- name: Build Success
|
53
|
-
if: success()
|
54
|
-
run: echo "::notice::Build validation passed successfully."
|
11
|
+
call-workflow-pull-validate:
|
12
|
+
uses: Hornbill-Docs/hdoc-library/.github/workflows/hdocbuild_shared_pull.yml@main
|
13
|
+
with:
|
14
|
+
branch: ${{ github.event.pull_request.head.sha }}
|
15
|
+
server_url: ${{ github.server_url }}
|
16
|
+
repo: ${{ github.repository }}
|
17
|
+
run_id: ${{ github.run_id }}
|
@@ -9,42 +9,7 @@ on:
|
|
9
9
|
workflow_dispatch:
|
10
10
|
|
11
11
|
jobs:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
# Checkout the relevant content for push or workflow_dispatch
|
17
|
-
- name: Checkout For Push or Workflow Dispatch
|
18
|
-
uses: actions/checkout@v2
|
19
|
-
with:
|
20
|
-
ref: ${{ github.event.inputs.branch }}
|
21
|
-
fetch-depth: 0
|
22
|
-
|
23
|
-
# Setup NodeJS LTS (18 currently)
|
24
|
-
- uses: actions/setup-node@v3
|
25
|
-
with:
|
26
|
-
node-version: 18
|
27
|
-
|
28
|
-
# Install hdoc-tools globally
|
29
|
-
- name: Install hdoc-tools
|
30
|
-
run: npm install hdoc-tools -g
|
31
|
-
|
32
|
-
# Run hdoc validate against checked-out content
|
33
|
-
- name: Perform Validation
|
34
|
-
id: hdocbuild
|
35
|
-
run: |
|
36
|
-
if result=`hdoc validate 2>&1`; then
|
37
|
-
printf "Build Success!\n\n"
|
38
|
-
printf "$result"
|
39
|
-
exit 0
|
40
|
-
else
|
41
|
-
valout=$(echo "$result" | awk '/Validation Output/,0')
|
42
|
-
printf "Build Failed!\n\n-----------------------\n"
|
43
|
-
printf "$valout"
|
44
|
-
exit 1
|
45
|
-
fi
|
46
|
-
|
47
|
-
# If build validation is successful, echo message
|
48
|
-
- name: Build Success
|
49
|
-
if: success()
|
50
|
-
run: echo "::notice::Build validation passed successfully."
|
12
|
+
call-workflow-push-validate:
|
13
|
+
uses: Hornbill-Docs/hdoc-library/.github/workflows/hdocbuild_shared_push.yml@main
|
14
|
+
with:
|
15
|
+
branch: ${{ github.event.inputs.branch }}
|