11name : Documentation
22on :
3- pull_request_target :
3+ pull_request :
44 issue_comment :
55 types : [created]
66 workflow_call :
1919 required : true
2020jobs :
2121 check-permissions :
22+ if : github.event_name == 'issue_comment'
2223 uses : patternfly/.github/.github/workflows/check-team-membership.yml@fdb52a63a2220ec8a3b6c2d43f312cda708ffa06
2324 secrets : inherit
2425
@@ -29,37 +30,61 @@ jobs:
2930 if : >-
3031 always() &&
3132 !cancelled() &&
32- (inputs.is-release || needs.check-permissions.outputs.allowed == 'true')
33+ (inputs.is-release || github.event_name != 'issue_comment' || needs.check-permissions.outputs.allowed == 'true')
3334 env :
3435 SURGE_LOGIN : ${{ secrets.SURGE_LOGIN }}
3536 SURGE_TOKEN : ${{ secrets.SURGE_TOKEN }}
3637 GH_PR_TOKEN : ${{ secrets.GH_PR_TOKEN }}
3738 GH_PR_NUM : ${{ needs.check-permissions.outputs.pr-number }}
3839 steps :
3940 - name : Check out project from PR branch
40- if : github.event_name == 'pull_request_target' || github.event_name == ' issue_comment'
41+ if : github.event_name == 'issue_comment'
4142 uses : actions/checkout@v4
4243 with :
43- # Checkout the merge commit so that we can access the PR's changes.
44- # This is nessesary because `pull_request_target` checks out the base branch (e.g. `main`) by default.
4544 ref : refs/pull/${{ env.GH_PR_NUM }}/head
4645
4746 - name : Check out project
48- if : inputs.is-release || github.event_name == 'workflow_call '
47+ if : github.event_name != 'issue_comment '
4948 uses : actions/checkout@v4
49+
5050 - name : Set up and build project
5151 uses : ./.github/actions/setup-project
5252
5353 - name : Build documentation
5454 run : yarn build:docs
5555
56- - name : Upload documentation
57- if : always()
56+ - name : Upload documentation preview
57+ if : always() && !cancelled() && github.event_name != 'pull_request'
5858 run : node .github/upload-preview.mjs packages/react-docs/public
5959
6060 - name : Run accessibility tests
6161 run : yarn serve:docs & yarn test:a11y
6262
6363 - name : Upload accessibility results
64- if : always()
64+ if : always() && !cancelled() && github.event_name != 'pull_request'
6565 run : node .github/upload-preview.mjs packages/react-docs/coverage
66+
67+ - name : Upload docs artifact
68+ if : always() && !cancelled() && github.event_name == 'pull_request'
69+ uses : actions/upload-artifact@v4
70+ with :
71+ name : documentation
72+ path : packages/react-docs/public
73+
74+ - name : Upload a11y artifact
75+ if : always() && !cancelled() && github.event_name == 'pull_request'
76+ uses : actions/upload-artifact@v4
77+ with :
78+ name : a11y-coverage
79+ path : packages/react-docs/coverage
80+
81+ - name : Save PR number
82+ if : always() && !cancelled() && github.event_name == 'pull_request'
83+ run : echo "${{ github.event.pull_request.number }}" > pr-number.txt
84+
85+ - name : Upload PR number
86+ if : always() && !cancelled() && github.event_name == 'pull_request'
87+ uses : actions/upload-artifact@v4
88+ with :
89+ name : pr-number
90+ path : pr-number.txt
0 commit comments