File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Doc Previewer"
2+ description : " Publish a preview of the documentation in a GitHub repository artifact"
3+ inputs :
4+ server :
5+ description : " URL of the server where the preview will be published"
6+ required : true
7+ job :
8+ description : " Name of the GitHub actions job where the artifact will be uploaded"
9+ required : true
10+ runs :
11+ using : " composite"
12+ steps :
13+ - name : " Call Doc Previewer Webhook"
14+ shell : bash
15+ env :
16+ PREVIEWER_URL : " ${{ inputs.server }}/preview/${{ github.repository }}/${{ github.event.issue.number }}?job=${{ inputs.job }}"
17+ ADD_COMMENT_URL : " https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments"
18+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19+ run : |
20+ PREVIEWER_RESPONSE=$(curl -X POST ${PREVIEWER_URL})
21+ if [[ $? ]]; then
22+ curl -H "Authorization: token ${GITHUB_TOKEN}" \
23+ -d '{"body": "${PREVIEWER_RESPONSE}"}' \
24+ ${ADD_COMMENT_URL}
25+ else
26+ echo $PREVIEWER_RESPONSE
27+ fi
You can’t perform that action at this time.
0 commit comments