From 5e6f624dc927847088684c4ced657fbea1ca5a6c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Sun, 15 Sep 2024 22:14:19 +0200 Subject: [PATCH] Update build_doc.yml --- .github/workflows/build_doc.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index 9e3eadd8464..83a228fe3bc 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -44,8 +44,8 @@ jobs: - name: Check comment body id: check_comment_body env: - trigger_build: ${{ inputs.pr_number || startsWith(env.comment_body, '/build:') || startsWith(env.comment_body, '/force-build:') }} - force_build: ${{ inputs.force_build || startsWith(env.comment_body, '/force-build:') }} + trigger_build: ${{ inputs && inputs.pr_number || startsWith(env.comment_body, '/build:') || startsWith(env.comment_body, '/force-build:') }} + force_build: ${{ inputs && inputs.force_build || startsWith(env.comment_body, '/force-build:') }} if: inputs.pr_number || startsWith(env.comment_body, '/build:') || startsWith(env.comment_body, '/force-build:') run: | if [ "${trigger_build}" = "false" ]; then @@ -55,15 +55,20 @@ jobs: echo "force_build=${force_build}" >> $GITHUB_OUTPUT - name: Check permissions - id: check_permissions if: 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' + run: | + echo "Not Authorized" + exit 1 + - name: Get PR number id: get_pr_number env: pr_number: ${{ inputs.pr_number || github.event.issue.number }} - run: echo "pr_number=${{ inputs.pr_number }}" >> $GITHUB_OUTPUT + run: echo "pr_number=$pr_number" >> $GITHUB_OUTPUT - name: Get doc version uses: actions/github-script@v7