@@ -88,60 +88,46 @@ jobs:
8888 row-format-link-pr : true
8989 hierarchy : true
9090
91- - name : Create and Push Tag
92- uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
93- env :
94- TAG_NAME : ${{ github.event.inputs.tag-name }}
95-
96- - name : Create and push tag
91+ - name : Create and Push Tag (standalone)
9792 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
9893 with :
9994 script : |
100- const tag = process.env.TAG_NAME
95+ const tag = core.getInput('tag-name')
10196 const ref = `refs/tags/${tag}`;
10297 const sha = context.sha; // The SHA of the commit to tag
98+ const tagMessage = `${tag} released by GitHub Action`;
99+
100+ const tagObject = await github.rest.git.createTag({
101+ owner: context.repo.owner,
102+ repo: context.repo.repo,
103+ tag: tag,
104+ message: tagMessage,
105+ object: sha,
106+ type: 'commit',
107+ tagger: {
108+ name: context.actor,
109+ email: `${context.actor}@users.noreply.github.com`,
110+ date: new Date().toISOString()
111+ }
112+ });
103113
104114 await github.rest.git.createRef({
105115 owner: context.repo.owner,
106116 repo: context.repo.repo,
107117 ref: ref,
108- sha: sha
118+ sha: tagObject.data. sha
109119 });
110120
111121 console.log(`Tag created: ${tag}`);
112122 github-token : ${{ secrets.GITHUB_TOKEN }}
113-
114- - name : Create Draft Release
115- uses : softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b
116- env :
117- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118- with :
119- name : ${{ github.event.inputs.tag-name }}
120- tag-name : ${{ github.event.inputs.tagName }}
121- chapters : |
122- - { title: No entry 🚫, label: duplicate }
123- - { title: Breaking Changes 💥, label: breaking-change }
124- - { title: New Features 🎉, label: enhancement }
125- - { title: Bugfixes 🛠, label: bug }
126- - { title: Infrastructure ⚙️, label: infrastructure }
127- - { title: Silent-live 🤫, label: silent-live }
128- - { title: Documentation 📜, label: documentation }
129- - { title: Closed Epics 📚, label: epic }
130- duplicity-scope : ' service'
131- duplicity-icon : ' 🔁'
132- warnings : true
133- skip-release-notes-labels : " no RN"
134- print-empty-chapters : false
135- row-format-issue : ' _{title}_ {developed-by} {co-authored-by} in #{number}'
136- row-format-pr : ' _{title}_ {developed-by} {co-authored-by} in #{number}'
137- row-format-link-pr : true
123+ tag-name : ${{ github.event.inputs.tag-name }}
138124
139125 - name : Create draft release
140126 uses : softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b
141127 env :
142128 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
143129 with :
144- name : ${{ github.event.inputs.tagName }}
130+ name : ${{ github.event.inputs.tag-name }}
145131 body : ${{ steps.generate_release_notes.outputs.release-notes }}
146132 tag_name : ${{ github.event.inputs.tag-name }}
147133 draft : true
0 commit comments