66 inputs :
77 strict :
88 description : ' Treat warnings as errors'
9- type : boolean
10- default : true
9+ type : string
10+ default : ' true'
1111 continue-on-error :
1212 description : ' Do not fail to publish if build fails'
13- type : boolean
13+ type : string
1414 required : false
15- default : true
15+ default : ' true'
1616
1717permissions :
1818 contents : read
2323 steps :
2424 - name : Checkout
2525 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
2649
2750 - name : Bootstrap Action Workspace
2851 if : github.repository == 'elastic/docs-builder'
@@ -40,18 +63,16 @@ jobs:
4063 - name : Build documentation
4164 if : github.repository != 'elastic/docs-builder'
4265 uses : elastic/docs-builder@main
43- continue-on-error : true
66+ continue-on-error : ${{ fromJSON(inputs.continue-on-error != '' && inputs.continue-on-error || 'false') }}
4467 with :
4568 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') }}
5470 - uses : actions/upload-artifact@v4
5571 with :
5672 name : docs
5773 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