From c4b30b108db87d47033dcb77d417349f6469dbde Mon Sep 17 00:00:00 2001 From: "Tobias.Mikula" Date: Fri, 22 May 2026 11:01:30 +0200 Subject: [PATCH 1/4] Generate Release Notes workflow implemented to the project --- .github/pull_request_template.md | 11 ++ .github/workflows/check_pr_release_notes.yml | 26 +++++ .github/workflows/release_draft.yml | 109 +++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/check_pr_release_notes.yml create mode 100644 .github/workflows/release_draft.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..323ac01 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ + +## Overview + + +## Release Notes +- TBD: 1st item of release notes +- TBD: 2nd item of release notes + + +## Related +Closes #issue_number diff --git a/.github/workflows/check_pr_release_notes.yml b/.github/workflows/check_pr_release_notes.yml new file mode 100644 index 0000000..80865c6 --- /dev/null +++ b/.github/workflows/check_pr_release_notes.yml @@ -0,0 +1,26 @@ +name: Check PR Release Notes + +on: + pull_request: + types: [opened, synchronize, reopened, edited, labeled, unlabeled] + branches: [ master ] + +jobs: + check-release-notes: + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + with: + python-version: '3.14' + + - name: Check presence of release notes in PR body + uses: AbsaOSS/release-notes-presence-check@8e586b26a5e27f899ee8590a5d988fd4780a3dbf + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + github-repository: ${{ github.repository }} + pr-number: ${{ github.event.number }} + title: "## [Rr]elease [Nn]otes" + skip-labels: 'no RN' + skip-placeholders: 'TBD' diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml new file mode 100644 index 0000000..2158ee6 --- /dev/null +++ b/.github/workflows/release_draft.yml @@ -0,0 +1,109 @@ +name: Draft Release +on: + workflow_dispatch: + inputs: + tag-name: + description: 'Name of git tag to be created, and then draft release created. Syntax: "v[0-9]+.[0-9]+.[0-9]+".' + required: false + from-tag-name: + description: >- + Name of the git tag from which to detect changes from. + Default value: latest tag. Syntax: "v[0-9]+.[0-9]+.[0-9]+". + required: false + +jobs: + release-draft: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + fetch-depth: 0 + persist-credentials: false + + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + with: + python-version: '3.14' + + - name: Check format of received target tag + id: check-version-tag + uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + github-repository: ${{ github.repository }} + version-tag: ${{ github.event.inputs.tag-name }} + + - name: Check format of received from tag + if: ${{ github.event.inputs.from-tag-name }} + id: check-version-from-tag + uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + github-repository: ${{ github.repository }} + version-tag: ${{ github.event.inputs.from-tag-name }} + should-exist: true + + - name: Generate Release Notes + id: generate_release_notes + uses: AbsaOSS/generate-release-notes@da535383f54a6532adb84e88d3b6e5c7236132df + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release-notes-title: "## [Rr]elease [Nn]otes" + tag-name: ${{ github.event.inputs.tag-name }} + from-tag-name: ${{ github.event.inputs.from-tag-name }} + chapters: | + - { title: New Features 🎉, label: enhancement, order: 20 } + - { title: Bugfixes 🛠, label: bug, order: 30 } + - { title: Dependencies ⚙️, label: dependencies, order: 50 } + - { title: No entry 🚫, label: duplicate, hidden: true, order: 99 } + warnings: true + print-empty-chapters: false + row-format-issue: '{type}: {number} _{title}_ by {developers} in {pull-requests}' + row-format-pr: '{number} _{title}_ by {developers}' + + - name: Create and push tag (standalone) + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 + with: + script: | + const tag = core.getInput('tag-name') + const ref = `refs/tags/${tag}`; + const sha = context.sha; // The SHA of the commit to tag + const tagMessage = `${tag} released by GitHub Action`; + + const tagObject = await github.rest.git.createTag({ + owner: context.repo.owner, + repo: context.repo.repo, + tag: tag, + message: tagMessage, + object: sha, + type: 'commit', + tagger: { + name: context.actor, + email: `${context.actor}@users.noreply.github.com`, + date: new Date().toISOString() + } + }); + + await github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: ref, + sha: tagObject.data.sha + }); + + console.log(`Tag created: ${tag}`); + github-token: ${{ secrets.GITHUB_TOKEN }} + tag-name: ${{ github.event.inputs.tag-name }} + + - name: Create draft release + uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: ${{ github.event.inputs.tag-name }} + body: ${{ steps.generate_release_notes.outputs.release-notes }} + tag_name: ${{ github.event.inputs.tag-name }} + draft: true + prerelease: false From f419230390b5f7237c81ac89e9b2038c0ab237ab Mon Sep 17 00:00:00 2001 From: "Tobias.Mikula" Date: Fri, 22 May 2026 11:42:41 +0200 Subject: [PATCH 2/4] Fix of correct using the provided tag name. --- .github/workflows/release_draft.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml index 2158ee6..62e0aca 100644 --- a/.github/workflows/release_draft.yml +++ b/.github/workflows/release_draft.yml @@ -65,9 +65,11 @@ jobs: - name: Create and push tag (standalone) uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 + env: + TAG_NAME: ${{ github.event.inputs.tag-name }} with: script: | - const tag = core.getInput('tag-name') + const tag = process.env.TAG_NAME; const ref = `refs/tags/${tag}`; const sha = context.sha; // The SHA of the commit to tag const tagMessage = `${tag} released by GitHub Action`; @@ -95,7 +97,6 @@ jobs: console.log(`Tag created: ${tag}`); github-token: ${{ secrets.GITHUB_TOKEN }} - tag-name: ${{ github.event.inputs.tag-name }} - name: Create draft release uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda From 6492916d9a2667dc92a739ec8f69c928c903e148 Mon Sep 17 00:00:00 2001 From: "Tobias.Mikula" Date: Fri, 22 May 2026 11:42:41 +0200 Subject: [PATCH 3/4] Fix of correct using the provided tag name. --- .github/workflows/release_draft.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml index 2158ee6..fed007b 100644 --- a/.github/workflows/release_draft.yml +++ b/.github/workflows/release_draft.yml @@ -4,7 +4,7 @@ on: inputs: tag-name: description: 'Name of git tag to be created, and then draft release created. Syntax: "v[0-9]+.[0-9]+.[0-9]+".' - required: false + required: true from-tag-name: description: >- Name of the git tag from which to detect changes from. @@ -65,9 +65,11 @@ jobs: - name: Create and push tag (standalone) uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 + env: + TAG_NAME: ${{ github.event.inputs.tag-name }} with: script: | - const tag = core.getInput('tag-name') + const tag = process.env.TAG_NAME; const ref = `refs/tags/${tag}`; const sha = context.sha; // The SHA of the commit to tag const tagMessage = `${tag} released by GitHub Action`; @@ -95,7 +97,6 @@ jobs: console.log(`Tag created: ${tag}`); github-token: ${{ secrets.GITHUB_TOKEN }} - tag-name: ${{ github.event.inputs.tag-name }} - name: Create draft release uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda From ae921270b7fe9a2cf3169714921bd720501355c7 Mon Sep 17 00:00:00 2001 From: "Tobias.Mikula" Date: Fri, 22 May 2026 14:22:00 +0200 Subject: [PATCH 4/4] Adding the concurrency to the workflow --- .github/workflows/check_pr_release_notes.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check_pr_release_notes.yml b/.github/workflows/check_pr_release_notes.yml index 80865c6..0374c09 100644 --- a/.github/workflows/check_pr_release_notes.yml +++ b/.github/workflows/check_pr_release_notes.yml @@ -5,6 +5,10 @@ on: types: [opened, synchronize, reopened, edited, labeled, unlabeled] branches: [ master ] +concurrency: + group: release-notes-check-${{ github.ref }} + cancel-in-progress: true + jobs: check-release-notes: runs-on: ubuntu-latest