diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1665ec400..a2e83b8bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,10 +14,19 @@ jobs: vars: name: Set Variables outputs: + pr: ${{ steps.pr.outputs.pr }} release-name: ${{ steps.release-name.outputs.release-name }} runs-on: ubuntu-22.04 timeout-minutes: 1 steps: + # Get PR number for squash merges to main + - name: Get PR Number From Event + if: ${{ github.event_name == 'push' }} + id: pr_no + uses: bcgov-nr/action-get-pr@main + - name: PR Number + id: pr + run: echo pr=${{ steps.pr_no.outputs.pr || inputs.pr}} >> $GITHUB_OUTPUT - name: Release Name id: release-name run: | @@ -38,7 +47,7 @@ jobs: with: registry: ghcr.io repository: ${{ github.repository }}/${{ matrix.package }} - target: test + target: ${{ needs.vars.outputs.pr }} tags: ${{ needs.vars.outputs.release-name }} deploys-uat: @@ -47,7 +56,7 @@ jobs: uses: ./.github/workflows/uat.yml secrets: inherit with: - tag: ${{ needs.vars.outputs.release-name }} + tag: ${{ needs.vars.outputs.pr }} promote-images-uat: name: Promote Images - Uat @@ -64,7 +73,7 @@ jobs: with: registry: ghcr.io repository: ${{ github.repository }}/${{ matrix.package }} - target: ${{ needs.vars.outputs.release-name }} + target: ${{ needs.vars.outputs.pr }} tags: uat deploys-prod: @@ -73,7 +82,7 @@ jobs: uses: ./.github/workflows/prod.yml secrets: inherit with: - tag: ${{ needs.vars.outputs.release-name }} + tag: ${{ needs.vars.outputs.pr }} promote-images-prod: name: Promote Images - Prod @@ -90,5 +99,5 @@ jobs: with: registry: ghcr.io repository: ${{ github.repository }}/${{ matrix.package }} - target: ${{ needs.vars.outputs.release-name }} + target: ${{ needs.vars.outputs.pr }} tags: prod