6
6
inputs :
7
7
strict :
8
8
description : ' Treat warnings as errors'
9
- type : boolean
10
- default : true
9
+ type : string
10
+ default : ' true'
11
11
continue-on-error :
12
12
description : ' Do not fail to publish if build fails'
13
- type : boolean
13
+ type : string
14
14
required : false
15
- default : true
15
+ default : ' true'
16
16
17
17
permissions :
18
18
contents : read
23
23
steps :
24
24
- name : Checkout
25
25
uses : actions/checkout@v4
26
+ with :
27
+ persist-credentials : false
28
+
29
+ - name : Store PR data
30
+ env :
31
+ PR_NUMBER : ${{ github.event.pull_request.number }}
32
+ PR_REF : ${{ github.event.pull_request.head.sha }}
33
+ run : |
34
+ cat << EOF > pull_request.json
35
+ {
36
+ "number": ${PR_NUMBER},
37
+ "ref": "${PR_REF}"
38
+ }
39
+ EOF
40
+
41
+ - name : Upload PR data
42
+ uses : actions/upload-artifact@v4
43
+ with :
44
+ name : pull-request-data
45
+ path : pull_request.json
46
+ if-no-files-found : error
47
+ retention-days : 1
48
+ compression-level : 1
26
49
27
50
- name : Bootstrap Action Workspace
28
51
if : github.repository == 'elastic/docs-builder'
@@ -40,18 +63,16 @@ jobs:
40
63
- name : Build documentation
41
64
if : github.repository != 'elastic/docs-builder'
42
65
uses : elastic/docs-builder@main
43
- continue-on-error : true
66
+ continue-on-error : ${{ fromJSON(inputs.continue-on-error != '' && inputs.continue-on-error || 'false') }}
44
67
with :
45
68
prefix : " /${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
46
- strict : true
47
- - name : Add pull request number to build
48
- env :
49
- PR_NUMBER : ${{ github.event.pull_request.number }}
50
- PR_REF : ${{ github.event.pull_request.head.sha }}
51
- run : |
52
- echo "${PR_NUMBER}" >> .artifacts/docs/html/pull_request_number.txt
53
- echo "${PR_REF}" >> .artifacts/docs/html/pull_request_ref.txt
69
+ strict : ${{ fromJSON(inputs.strict != '' && inputs.strict || 'true') }}
54
70
- uses : actions/upload-artifact@v4
55
71
with :
56
72
name : docs
57
73
path : .artifacts/docs/html/
74
+ if-no-files-found : error
75
+ retention-days : 1
76
+ # The lower the compression-level, the faster the artifact will be uploaded.
77
+ # But the size of the artifact will be larger.
78
+ compression-level : 1
0 commit comments