mirror of https://github.com/CGAL/cgal
actual fix of build_doc.yml [skip ci]
This commit is contained in:
parent
e9c84037e5
commit
634e9ac787
|
|
@ -1,4 +1,4 @@
|
||||||
name: Documentation
|
name: Build Documentation
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
@ -30,7 +30,7 @@ permissions:
|
||||||
jobs:
|
jobs:
|
||||||
pre_build_checks:
|
pre_build_checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Checks if the workflow should be executed
|
name: Trigger the build?
|
||||||
outputs:
|
outputs:
|
||||||
trigger_build: ${{ steps.get_doc_version.outputs.result && steps.get_doc_version.outputs.result != '' }}
|
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 }}
|
||||||
|
|
@ -57,24 +57,24 @@ jobs:
|
||||||
echo "trigger_build=${trigger_build}" >> $GITHUB_OUTPUT
|
echo "trigger_build=${trigger_build}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Check permissions
|
- name: Check permissions
|
||||||
if: ${{ fromJSON(steps.check_comment_body.outputs.trigger_build) }} && (inputs.pr_number || env.author_association == 'OWNER' || env.author_association == 'MEMBER')
|
if: ( steps.check_comment_body.outputs.trigger_build || false ) && (inputs.pr_number || env.author_association == 'OWNER' || env.author_association == 'MEMBER')
|
||||||
run: echo "Authorized"
|
run: echo "Authorized"
|
||||||
|
|
||||||
- name: No permissions
|
- name: No permissions
|
||||||
if: ${{ fromJSON(steps.check_comment_body.outputs.trigger_build) }} && (! inputs.pr_number && env.author_association != 'OWNER' && env.author_association != 'MEMBER' )
|
if: ( steps.check_comment_body.outputs.trigger_build || false ) && (! inputs.pr_number && env.author_association != 'OWNER' && env.author_association != 'MEMBER' )
|
||||||
run: |
|
run: |
|
||||||
echo 'ERROR: User ${{ github.actor }} is not allowed to trigger the build of the documentation with /build:* or /force-build:*'
|
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) }}
|
if: ( steps.check_comment_body.outputs.trigger_build || false )
|
||||||
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) }}
|
if: ( steps.check_comment_body.outputs.trigger_build || false )
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
id: get_doc_version
|
id: get_doc_version
|
||||||
with:
|
with:
|
||||||
|
|
@ -92,7 +92,8 @@ jobs:
|
||||||
throw new Error('No version found')
|
throw new Error('No version found')
|
||||||
|
|
||||||
build_doc:
|
build_doc:
|
||||||
name: Build PR Documentation
|
name: |
|
||||||
|
${{ format('{0}: Build Documentation version "{1}"', github.actor, needs.pre_build_checks.outputs.doc_version) }}
|
||||||
needs: pre_build_checks
|
needs: pre_build_checks
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # to fetch code (actions/checkout)
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue