diff --git a/.github/workflows/ce-provision-publish-docs.yml b/.github/workflows/ce-provision-publish-docs.yml index dceaf2687..be0c8479b 100644 --- a/.github/workflows/ce-provision-publish-docs.yml +++ b/.github/workflows/ce-provision-publish-docs.yml @@ -8,13 +8,27 @@ on: - 1.x - 2.x workflow_dispatch: +# Set target docs branch name +env: + docs_branch: docs-${{ github.event.pull_request.base.ref }} jobs: - # Set the job key. The key is displayed as the job name - # when a job name is not provided - public-docs: + # See https://stackoverflow.com/a/74378072 + set-docs-branch: + name: Make docs branch name available to publish-docs job + runs-on: ubuntu-latest + outputs: + docs_branch: ${{ steps.init.outputs.docs_branch }} + + steps: + - name: Make environment variables global + id: init + run: | + echo "docs_branch=${{ env.docs_branch }}" >> $GITHUB_OUTPUT + + publish-docs: # Only run the job if it is not coming from a documentation branch - if: ${{ github.event.pull_request.head.ref != 'docs-${{ github.event.pull_request.base.ref }}' }} + if: ${{ github.event.pull_request.head.ref != needs.set-docs-branch.outputs.docs_branch }} # Name the Job name: Publish the ce-provision docs to GitHub # Set the type of machine to run on