From 3afe2f16d195e3c7e98404d36418ddb8ef09380d Mon Sep 17 00:00:00 2001 From: Mike Lyttle Date: Thu, 28 Nov 2024 17:05:33 -0800 Subject: [PATCH] fix: update merge workflow handling of PR number inputs --- .github/workflows/merge.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 6290779b..d1f0eeeb 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -24,14 +24,24 @@ jobs: vars: name: Set Variables outputs: - pr: ${{ steps.pr.outputs.pr }} + pr: ${{ steps.pr-selector.outputs.pr }} runs-on: ubuntu-24.04 timeout-minutes: 1 steps: - # Get PR number for squash merges to main + # Get PR number for squash merges to main if not specified as input - name: PR Number id: pr + if: github.event.inputs.pr_no == null uses: bcgov-nr/action-get-pr@v0.0.1 + # Get the appropriate PR number output value depending on whether input was specified + - name: PR Number Selector + id: pr-selector + run: | + if [[ "${{ github.event.inputs.pr_no }}" == "" ]]; then + echo "pr=${{ steps.pr.outputs.pr }}" >> $GITHUB_OUTPUT + else + echo "pr=${{ github.event.inputs.pr_no }}" >> $GITHUB_OUTPUT + fi # https://github.com/bcgov/quickstart-openshift-helpers deploy-test: