Skip to content

Commit

Permalink
try to fix build_doc [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lrineau committed Sep 23, 2024
1 parent b2a0987 commit e9c8403
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
runs-on: ubuntu-latest
name: Checks if the workflow should be executed
outputs:
trigger_build: ${{ steps.get_doc_version.outputs.result && steps.get_doc_version.outputs.result != '' }}
force_build: ${{ steps.check_comment_body.outputs.force_build }}
pr_number: ${{ steps.get_pr_number.outputs.pr_number }}
doc_version: ${{ steps.get_doc_version.outputs.result }}
Expand All @@ -53,24 +54,27 @@ jobs:
exit 1
fi
echo "force_build=${force_build}" >> $GITHUB_OUTPUT
echo "trigger_build=${trigger_build}" >> $GITHUB_OUTPUT
- 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"

- 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: |
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
- name: Get PR number
if: ${{ fromJSON(steps.check_comment_body.outputs.trigger_build) }}
id: get_pr_number
env:
pr_number: ${{ inputs.pr_number || github.event.issue.number }}
run: echo "pr_number=$pr_number" >> $GITHUB_OUTPUT

- name: Get doc version
if: ${{ fromJSON(steps.check_comment_body.outputs.trigger_build) }}
uses: actions/github-script@v7
id: get_doc_version
with:
Expand Down Expand Up @@ -98,6 +102,7 @@ jobs:
force_build: ${{ needs.pre_build_checks.outputs.force_build }}
pr_number: ${{ needs.pre_build_checks.outputs.pr_number }}
doc_version: ${{ needs.pre_build_checks.outputs.doc_version }}
if: ${{ fromJSON(needs.pre_build_checks.outputs.trigger_build) }}
steps:

- name: Emoji-comment
Expand Down

0 comments on commit e9c8403

Please sign in to comment.