11# Auto tag - Automated semantic versioning based on conventional commits
2- # Mirrors toon4s setup for FlowForge
32name : Auto tag
43
54on :
2827 token : ${{ secrets.GITHUB_TOKEN }}
2928
3029 - name : Check and clean incomplete releases
31- id : check_release
3230 uses : actions/github-script@v7
3331 with :
3432 script : |
@@ -45,16 +43,13 @@ jobs:
4543 repo: context.repo.repo,
4644 tag: tag.name
4745 });
48- console.log(`Release exists for tag ${tag.name}`);
4946 } catch (error) {
5047 if (error.status === 404) {
51- console.log(`No release found for tag ${tag.name}, deleting tag`);
5248 await github.rest.git.deleteRef({
5349 owner: context.repo.owner,
5450 repo: context.repo.repo,
5551 ref: `tags/${tag.name}`
5652 });
57- console.log(`Deleted tag ${tag.name}`);
5853 }
5954 }
6055 }
9287 tag: '${{ steps.tag_version.outputs.new_tag }}'
9388 }
9489 });
95-
96- - name : Summary
97- if : steps.tag_version.outputs.new_tag != ''
98- run : |
99- echo "## Tag Created Successfully" >> $GITHUB_STEP_SUMMARY
100- echo "" >> $GITHUB_STEP_SUMMARY
101- echo "**New Tag**: \`${{ steps.tag_version.outputs.new_tag }}\`" >> $GITHUB_STEP_SUMMARY
102- echo "**Previous Tag**: \`${{ steps.tag_version.outputs.previous_tag }}\`" >> $GITHUB_STEP_SUMMARY
103- echo "**Version Bump**: \`${{ steps.tag_version.outputs.part }}\`" >> $GITHUB_STEP_SUMMARY
104- echo "" >> $GITHUB_STEP_SUMMARY
105- echo "**Changelog**:" >> $GITHUB_STEP_SUMMARY
106- echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
107- echo "${{ steps.tag_version.outputs.changelog }}" >> $GITHUB_STEP_SUMMARY
108- echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
109- echo "" >> $GITHUB_STEP_SUMMARY
110- echo "🚀 Release workflow triggered via repository_dispatch" >> $GITHUB_STEP_SUMMARY
111-
112- - name : No tag created
113- if : steps.tag_version.outputs.new_tag == ''
114- run : |
115- echo "## No Tag Created" >> $GITHUB_STEP_SUMMARY
116- echo "" >> $GITHUB_STEP_SUMMARY
117- echo "No version bump needed based on commit messages" >> $GITHUB_STEP_SUMMARY
0 commit comments