From 937af636d3023adc8796416bc85ea257cf6a39e9 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:41:28 -0700 Subject: [PATCH] Check environment-file and pip-install-target inputs These are marked as optional in the inputs block. There was an implicit assumption that it's required to have one of the inputs but not both. This can't be encoded in the inputs block so check the values as the very first step. --- .github/workflows/docs-ci.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/docs-ci.yaml b/.github/workflows/docs-ci.yaml index 0d9b7c6..47782ed 100644 --- a/.github/workflows/docs-ci.yaml +++ b/.github/workflows/docs-ci.yaml @@ -55,6 +55,17 @@ jobs: run: shell: bash -l {0} steps: + - name: Check inputs + if: (inputs.environment-file == '' && inputs.pip-install-target == '') || + (inputs.environment-file != '' && inputs.pip-install-target != '') + run: | + cat <<~~ + This workflow requires one (and only one) of the following inputs: + - environment-file + - pip-install-target + ~~ + exit 1 + - uses: actions/checkout@v4 with: repository: ${{ inputs.repo }}