Skip to content

Commit d84e906

Browse files
committed
fix latest release on edit
1 parent 95bc9b5 commit d84e906

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/module_release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,18 @@ jobs:
123123
echo "release_action=create" >> $GITHUB_OUTPUT
124124
fi
125125
126+
# is latest tag?
127+
LAST_TAG=$(git for-each-ref refs/tags --sort='-*creatordate' --format='%(refname:short)' --count=1)
128+
if [[ "${LAST_TAG}" == "${{ steps.metadata.outputs.tag }}" ]] ; then
129+
echo "latest=true" >> $GITHUB_OUTPUT
130+
else
131+
echo "latest=false" >> $GITHUB_OUTPUT
132+
fi
133+
126134
- name: "${{ steps.tag.outputs.release_action }} release for ${{ steps.metadata.outputs.tag }}"
127135
if: ${{ inputs.release == true || inputs.release == 'true' || steps.tag.outputs.undraft == 'true' }}
128136
run: |
129-
gh release ${{ steps.tag.outputs.release_action }} ${{ steps.metadata.outputs.tag }} --draft=false --title ${{ steps.metadata.outputs.tag }} -F OUTPUT.md
137+
gh release ${{ steps.tag.outputs.release_action }} ${{ steps.metadata.outputs.tag }} --latest=${{ steps.tag.outputs.latest }} --draft=false --title ${{ steps.metadata.outputs.tag }} -F OUTPUT.md
130138
131139
- name: "Publish module"
132140
if: ${{ inputs.publish == true || inputs.publish == 'true' }}

0 commit comments

Comments
 (0)