From 2f94c29c7ecfd92d4beaac54dcc849b8da3159b4 Mon Sep 17 00:00:00 2001 From: MarvinF Date: Tue, 24 Jun 2025 22:05:24 +0200 Subject: [PATCH 1/7] Update build_release.yml --- .github/workflows/build_release.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 77fad19..5b82a1b 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -26,20 +26,32 @@ jobs: run: npm ci - name: Generate release notes - id: release_notes + id: release_notes_extension uses: release-drafter/release-drafter@v6 with: - config-name: release-drafter.yml + config-name: release-drafter_extension.yml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Save release notes to file run: | - echo "${{ steps.release_notes.outputs.body }}" > RELEASE_NOTES.md + echo "${{ steps.release_notes_extension.outputs.body }}" > RELEASE_NOTES.md - name: Run build script run: npm run release + - name: Generate release notes + id: release_notes_github + uses: release-drafter/release-drafter@v6 + with: + config-name: release-drafter_github.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Save release notes to file + run: | + echo "${{ steps.release_notes_github.outputs.body }}" > RELEASE_NOTES.md + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: From e05d107af30f4a7007d34bdb9ef6463374c46792 Mon Sep 17 00:00:00 2001 From: MarvinF Date: Tue, 24 Jun 2025 22:05:51 +0200 Subject: [PATCH 2/7] Rename release-drafter.yml to release-drafter_extension.yml --- .github/{release-drafter.yml => release-drafter_extension.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{release-drafter.yml => release-drafter_extension.yml} (100%) diff --git a/.github/release-drafter.yml b/.github/release-drafter_extension.yml similarity index 100% rename from .github/release-drafter.yml rename to .github/release-drafter_extension.yml From 6c3c9badfd46e95831f9b0539d2940a7a0ff173c Mon Sep 17 00:00:00 2001 From: MarvinF Date: Tue, 24 Jun 2025 22:06:27 +0200 Subject: [PATCH 3/7] Create release-drafter_github.yml --- .github/release-drafter_github.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/release-drafter_github.yml diff --git a/.github/release-drafter_github.yml b/.github/release-drafter_github.yml new file mode 100644 index 0000000..2e4b7f4 --- /dev/null +++ b/.github/release-drafter_github.yml @@ -0,0 +1,22 @@ +name-template: "Release $NEXT_PATCH_VERSION" +tag-template: "v$NEXT_PATCH_VERSION" + +exclude: + pulls: true + +categories: + - title: "Features" + labels: ["feature", "enhancement"] + - title: "Fixes" + labels: ["bug"] + - title: "Maintenance" + labels: ["chore", "refactor"] + +change-template: "- $TITLE ([#$NUMBER]($URL))" + +template: | + # Release $NEXT_PATCH_VERSION + + ## Changes + + $CHANGES From 67b46f121a1796d75927f40e6f8279975a82796d Mon Sep 17 00:00:00 2001 From: MarvinF Date: Tue, 24 Jun 2025 22:31:47 +0200 Subject: [PATCH 4/7] Update release-drafter_extension.yml --- .github/release-drafter_extension.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/release-drafter_extension.yml b/.github/release-drafter_extension.yml index 2e4b7f4..a0e82d9 100644 --- a/.github/release-drafter_extension.yml +++ b/.github/release-drafter_extension.yml @@ -1,8 +1,11 @@ -name-template: "Release $NEXT_PATCH_VERSION" -tag-template: "v$NEXT_PATCH_VERSION" +name-template: "Release $COMPLETE" +tag-template: "v$COMPLETE" exclude: pulls: true +exclude-labels: + - prod-merge + - stage-merge categories: - title: "Features" @@ -12,10 +15,10 @@ categories: - title: "Maintenance" labels: ["chore", "refactor"] -change-template: "- $TITLE ([#$NUMBER]($URL))" +change-template: "- $TITLE [#$NUMBER]" template: | - # Release $NEXT_PATCH_VERSION + # Release $COMPLETE ## Changes From 3422813152ec667a6a92647a9d66066973b3c23b Mon Sep 17 00:00:00 2001 From: MarvinF Date: Tue, 24 Jun 2025 22:32:31 +0200 Subject: [PATCH 5/7] Update release-drafter_github.yml --- .github/release-drafter_github.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/release-drafter_github.yml b/.github/release-drafter_github.yml index 2e4b7f4..9501a03 100644 --- a/.github/release-drafter_github.yml +++ b/.github/release-drafter_github.yml @@ -1,5 +1,5 @@ -name-template: "Release $NEXT_PATCH_VERSION" -tag-template: "v$NEXT_PATCH_VERSION" +name-template: "Release $COMPLETE" +tag-template: "v$COMPLETE" exclude: pulls: true @@ -15,8 +15,6 @@ categories: change-template: "- $TITLE ([#$NUMBER]($URL))" template: | - # Release $NEXT_PATCH_VERSION - ## Changes $CHANGES From e2b6f484988ba32426cd4cd2d9d4e5fc268ef0c7 Mon Sep 17 00:00:00 2001 From: MarvinF Date: Tue, 24 Jun 2025 22:33:49 +0200 Subject: [PATCH 6/7] Update release-drafter_github.yml --- .github/release-drafter_github.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/release-drafter_github.yml b/.github/release-drafter_github.yml index 9501a03..a33f24e 100644 --- a/.github/release-drafter_github.yml +++ b/.github/release-drafter_github.yml @@ -3,6 +3,9 @@ tag-template: "v$COMPLETE" exclude: pulls: true +exclude-labels: + - prod-merge + - stage-merge categories: - title: "Features" From 089796d2011cf9adae25e5f5ad735c4896bdb880 Mon Sep 17 00:00:00 2001 From: MarvinF Date: Tue, 24 Jun 2025 22:37:05 +0200 Subject: [PATCH 7/7] Create autolabel.yaml --- .github/workflows/autolabel.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/autolabel.yaml diff --git a/.github/workflows/autolabel.yaml b/.github/workflows/autolabel.yaml new file mode 100644 index 0000000..bec469a --- /dev/null +++ b/.github/workflows/autolabel.yaml @@ -0,0 +1,31 @@ +name: Auto-label PRs + +on: + pull_request: + types: [opened, reopened, synchronize, edited] + +jobs: + label-stage-to-prod: + runs-on: ubuntu-latest + steps: + - name: Label PRs + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const base = context.payload.pull_request.base.ref; + const head = context.payload.pull_request.head.ref; + + if (base === 'sportsmanager2-prod' && head === 'sportsmanager2-stage') { + await github.rest.issues.addLabels({ + ...context.repo, + issue_number: context.payload.pull_request.number, + labels: ['prod-merge'] + }); + } else if (base === 'sportsmanager2-stage' && head === 'sportsmanager2-dev') { + await github.rest.issues.addLabels({ + ...context.repo, + issue_number: context.payload.pull_request.number, + labels: ['stage-merge'] + }); + }