Skip to content

Commit

Permalink
Mark stable tags from default branch as latest
Browse files Browse the repository at this point in the history
Do not mark stable tags from release or maintenance branches as latest.
  • Loading branch information
rustydb committed Nov 7, 2024
1 parent be71c4e commit 9d89c46
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/promote-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,33 @@ on:
- 'v?[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

env:
LATEST: false
jobs:
make-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get Branch
run: |
mapfile -t branches < <(git branch -r --contains ${{ github.ref }} | awk '{print $1}')
echo "${branches[@]}"
for branch in "${branches[@]}"; do
branch_name="${branch/origin\/}"
echo "${branch_name}"
if [ "${branch_name}" = 'main' ]; then
echo LATEST=true >> $GITHUB_ENV
break
fi
done
- uses: ncipollo/release-action@v1
with:
allowUpdates: true # if the job is re-ran to catch missed artifacts, allow updates
generateReleaseNotes: true
prerelease: false
makeLatest: true
makeLatest: ${{ fromJSON(env.LATEST) }}

build-and-promote:
needs: make-release
Expand Down

0 comments on commit 9d89c46

Please sign in to comment.