mirror of https://github.com/CGAL/cgal
try to fix build_doc [skip ci]
This commit is contained in:
parent
b2a09877f9
commit
e9c84037e5
|
|
@ -32,6 +32,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Checks if the workflow should be executed
|
name: Checks if the workflow should be executed
|
||||||
outputs:
|
outputs:
|
||||||
|
trigger_build: ${{ steps.get_doc_version.outputs.result && steps.get_doc_version.outputs.result != '' }}
|
||||||
force_build: ${{ steps.check_comment_body.outputs.force_build }}
|
force_build: ${{ steps.check_comment_body.outputs.force_build }}
|
||||||
pr_number: ${{ steps.get_pr_number.outputs.pr_number }}
|
pr_number: ${{ steps.get_pr_number.outputs.pr_number }}
|
||||||
doc_version: ${{ steps.get_doc_version.outputs.result }}
|
doc_version: ${{ steps.get_doc_version.outputs.result }}
|
||||||
|
|
@ -53,24 +54,27 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "force_build=${force_build}" >> $GITHUB_OUTPUT
|
echo "force_build=${force_build}" >> $GITHUB_OUTPUT
|
||||||
|
echo "trigger_build=${trigger_build}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Check permissions
|
- name: Check permissions
|
||||||
if: inputs.pr_number || env.author_association == 'OWNER' || env.author_association == 'MEMBER'
|
if: ${{ fromJSON(steps.check_comment_body.outputs.trigger_build) }} && (inputs.pr_number || env.author_association == 'OWNER' || env.author_association == 'MEMBER')
|
||||||
run: echo "Authorized"
|
run: echo "Authorized"
|
||||||
|
|
||||||
- name: No permissions
|
- name: No permissions
|
||||||
if: ${{ ! inputs.pr_number && env.author_association != 'OWNER' && env.author_association != 'MEMBER' }}
|
if: ${{ fromJSON(steps.check_comment_body.outputs.trigger_build) }} && (! inputs.pr_number && env.author_association != 'OWNER' && env.author_association != 'MEMBER' )
|
||||||
run: |
|
run: |
|
||||||
echo "Not Authorized"
|
echo 'ERROR: User ${{ github.actor }} is not allowed to trigger the build of the documentation with /build:* or /force-build:*'
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Get PR number
|
- name: Get PR number
|
||||||
|
if: ${{ fromJSON(steps.check_comment_body.outputs.trigger_build) }}
|
||||||
id: get_pr_number
|
id: get_pr_number
|
||||||
env:
|
env:
|
||||||
pr_number: ${{ inputs.pr_number || github.event.issue.number }}
|
pr_number: ${{ inputs.pr_number || github.event.issue.number }}
|
||||||
run: echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
|
run: echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Get doc version
|
- name: Get doc version
|
||||||
|
if: ${{ fromJSON(steps.check_comment_body.outputs.trigger_build) }}
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
id: get_doc_version
|
id: get_doc_version
|
||||||
with:
|
with:
|
||||||
|
|
@ -98,6 +102,7 @@ jobs:
|
||||||
force_build: ${{ needs.pre_build_checks.outputs.force_build }}
|
force_build: ${{ needs.pre_build_checks.outputs.force_build }}
|
||||||
pr_number: ${{ needs.pre_build_checks.outputs.pr_number }}
|
pr_number: ${{ needs.pre_build_checks.outputs.pr_number }}
|
||||||
doc_version: ${{ needs.pre_build_checks.outputs.doc_version }}
|
doc_version: ${{ needs.pre_build_checks.outputs.doc_version }}
|
||||||
|
if: ${{ fromJSON(needs.pre_build_checks.outputs.trigger_build) }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Emoji-comment
|
- name: Emoji-comment
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue