From d8c19136bf4776fca823e2f5605a8da6e51680ba Mon Sep 17 00:00:00 2001 From: Jev Forsberg <46619047+baldm0mma@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:17:01 -0700 Subject: [PATCH] CI: Fix `latest` tag not being correctly applied to releases (#96497) * baldm0mma/tag_latest_bug/ update github-release.yml default values * baldm0mma/tag_latest_bug/ update release-comms.yml * baldm0mma/tag_latest_bug/ update logic * baldm0mma/tag_latest_bug/ update logic * baldm0mma/tag_latest_bug/ update logic * baldm0mma/tag_latest_bug/ update logic for both cases * baldm0mma/tag_latest_bug/ update comment --- .github/workflows/github-release.yml | 3 ++- .github/workflows/release-comms.yml | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index a46a12134bf..8cbe3030ffe 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -8,7 +8,7 @@ on: type: string latest: required: false - default: false + default: "0" description: Mark this release as latest (`1`) or not (`0`, default) type: string dry_run: @@ -23,6 +23,7 @@ on: type: string latest: required: false + default: "0" description: Mark this release as latest (`1`) or not (`0`, default) type: string dry_run: diff --git a/.github/workflows/release-comms.yml b/.github/workflows/release-comms.yml index dc7355ef0b8..02d53057184 100644 --- a/.github/workflows/release-comms.yml +++ b/.github/workflows/release-comms.yml @@ -8,10 +8,11 @@ on: dry_run: required: false default: true + type: boolean version: required: true latest: - type: bool + type: boolean default: false pull_request: types: @@ -30,17 +31,18 @@ jobs: latest: ${{ steps.output.outputs.latest }} runs-on: ubuntu-latest steps: + # The github-release action expects a `LATEST` value of a string of either '1' or '0' - if: ${{ github.event_name == 'workflow_dispatch' }} run: | echo setting up GITHUB_ENV for ${{ github.event_name }} echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV echo "DRY_RUN=${{ inputs.dry_run }}" >> $GITHUB_ENV - echo "LATEST=${{ inputs.latest }}" >> $GITHUB_ENV + echo "LATEST=${{ inputs.latest && '1' || '0' }}" >> $GITHUB_ENV - if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') }} run: | echo "VERSION=$(echo ${{ github.head_ref }} | sed -e 's/release\/.*\///g')" >> $GITHUB_ENV echo "DRY_RUN=${{ contains(github.event.pull_request.labels.*.name, 'release/dry-run') }}" >> $GITHUB_ENV - echo "LATEST=${{ contains(github.event.pull_request.labels.*.name, 'release/latest') }}" >> $GITHUB_ENV + echo "LATEST=${{ contains(github.event.pull_request.labels.*.name, 'release/latest') && '1' || '0' }}" >> $GITHUB_ENV - id: output run: | echo "dry_run: $DRY_RUN"