From 4cd1a27e14b82b2f2bccc8949821fcff079f7b9b Mon Sep 17 00:00:00 2001 From: "Tobias.Mikula" Date: Fri, 22 May 2026 12:11:40 +0200 Subject: [PATCH] Adapting the release notes workflow to the project. --- .github/workflows/check_pr_release_notes.yml | 18 +---- .github/workflows/release_draft.yml | 79 +++++++++----------- 2 files changed, 37 insertions(+), 60 deletions(-) diff --git a/.github/workflows/check_pr_release_notes.yml b/.github/workflows/check_pr_release_notes.yml index 566846c..3e10169 100644 --- a/.github/workflows/check_pr_release_notes.yml +++ b/.github/workflows/check_pr_release_notes.yml @@ -1,19 +1,3 @@ -# -# Copyright 2025 ABSA Group Limited -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - name: Check PR Release Notes on: @@ -28,7 +12,7 @@ jobs: steps: - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: - python-version: '3.13' + python-version: '3.14' - name: Check presence of release notes in PR description uses: AbsaOSS/release-notes-presence-check@8e586b26a5e27f899ee8590a5d988fd4780a3dbf diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml index 7aa5e87..f9f8f10 100644 --- a/.github/workflows/release_draft.yml +++ b/.github/workflows/release_draft.yml @@ -1,19 +1,3 @@ -# -# Copyright 2025 ABSA Group Limited -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - name: Draft Release on: workflow_dispatch: @@ -22,7 +6,9 @@ on: description: 'Name of git tag to be created, and then draft release created. Syntax: "v[0-9]+.[0-9]+.[0-9]+".' required: true 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]+".' + 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: @@ -36,9 +22,9 @@ jobs: - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: - python-version: '3.13' + python-version: '3.14' - - name: Check Format of Received Tag + - name: Check format of received target tag id: check-version-tag uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 env: @@ -47,7 +33,7 @@ jobs: github-repository: ${{ github.repository }} version-tag: ${{ github.event.inputs.tag-name }} - - name: Check Format of Received From Tag + - 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 @@ -60,55 +46,62 @@ jobs: - name: Generate Release Notes id: generate_release_notes - uses: AbsaOSS/generate-release-notes@B90223510d1704301a36a36f0d86a72a0e72f0cf + 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": "Entries to skip 🚫", "label": "duplicate"} - - {"title": "Entries to skip 🚫", "label": "invalid"} - - {"title": "Entries to skip 🚫", "label": "wontfix"} - - {"title": "Entries to skip 🚫", "label": "no RN"} - - {"title": "Breaking Changes 💥", "label": "breaking change"} - - {"title": "Security updates 👮", "label": "security"} - - {"title": "New Features 🎉", "label": "enhancement"} - - {"title": "Bugfixes 🛠", "label": "bug"} - - {"title": "Epics 📖", "label": "epic"} - - {"title": "Infrastructure ⚙️", "label": "infrastructure"} - - {"title": "Silent-live 🤫", "label": "silent live"} - - {"title": "Documentation 📜", "label": "documentation"} - duplicity-scope: 'none' + - { title: Breaking Changes 💥, label: breaking change, order: 10 } + - { title: New Features 🎉, label: enhancement, order: 20 } + - { title: Bugfixes 🛠, label: bug, order: 30 } + - { title: Infrastructure ⚙️, label: infrastructure, order: 40 } + - { title: Refactoring 🚀, label: refactoring, order: 50 } + - { title: Documentation 📜, label: documentation, order: 60 } + - { title: No entry 🚫, label: duplicate, hidden: true, order: 99 } warnings: true - skip-release-notes-labels: "no RN,duplicate,invalid,wontfix" print-empty-chapters: false - row-format-issue: '_{title}_ {developers} in {number}' - row-format-pr: '_{title}_ {developers} in {number}' - row-format-link-pr: true - hierarchy: true + row-format-issue: '{type}: {number} _{title}_ by {developers} in {pull-requests}' + row-format-pr: '{number} _{title}_ by {developers}' - - name: Create and Push Tag + - name: Create and push tag uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 env: TAG_NAME: ${{ github.event.inputs.tag-name }} with: script: | - const tag = process.env.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`; + + 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: sha + sha: tagObject.data.sha }); console.log(`Tag created: ${tag}`); github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Create Draft Release + - name: Create draft release uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}