Skip to content

Commit e57c0d3

Browse files
committed
fix latest release on edit
1 parent 4b8c95d commit e57c0d3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/module_release.yml

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

0 commit comments

Comments
 (0)