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
This commit is contained in:
Jev Forsberg 2024-11-19 10:17:01 -07:00 committed by GitHub
parent aace94438e
commit d8c19136bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -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:

View File

@ -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"