From ccb587bc82fc5c3368ba623094802f7d929e9006 Mon Sep 17 00:00:00 2001 From: Ayush8923 <80516839+Ayush8923@users.noreply.github.com> Date: Wed, 17 Jun 2026 12:07:17 +0530 Subject: [PATCH 1/3] fix(*): semantic release issue --- .github/workflows/pre-release.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 89053cf..9cc9172 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -55,22 +55,12 @@ jobs: @semantic-release/release-notes-generator \ @semantic-release/github - - name: Create conventional commit - env: - COMMIT_TYPE: ${{ steps.pr-type.outputs.type }} - run: | - git config user.email "ci@github.com" - git config user.name "GitHub CI" - ORIGINAL_MSG=$(git log -1 --pretty=%s) - git commit --allow-empty -m "${COMMIT_TYPE}: ${ORIGINAL_MSG}" - - name: Run semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - unset GITHUB_ACTIONS - unset GITHUB_EVENT_NAME - npx semantic-release --branches ${{ github.event.pull_request.base.ref }} + GITHUB_EVENT_NAME: push + GITHUB_REF: refs/heads/${{ github.event.pull_request.base.ref }} + run: npx semantic-release - name: Rewrite notes (cumulative, grouped, since last stable) if: success() From 3961adb629949af73a5ce6382342fee6e476cc36 Mon Sep 17 00:00:00 2001 From: Ayush8923 <80516839+Ayush8923@users.noreply.github.com> Date: Wed, 17 Jun 2026 12:55:06 +0530 Subject: [PATCH 2/3] fix(*): make the semantic releae versioning based on the commit --- .github/PULL_REQUEST_TEMPLATE.md | 6 ------ .github/workflows/pre-release.yml | 25 ++----------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d11de29..1b0b343 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,12 +2,6 @@ Closes #PLEASE_TYPE_ISSUE_NUMBER -## Type - -type: <-- Add the type of the PR --> - - - ## Summary Explain the **motivation** for making this change. What existing problem does the pull request solve? diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 9cc9172..72581ad 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -1,8 +1,7 @@ name: Pre-release Tag on: - pull_request: - types: [closed] + push: branches: [main] concurrency: @@ -11,7 +10,6 @@ concurrency: jobs: pre-release: - if: github.event.pull_request.merged == true runs-on: ubuntu-latest name: Pre-Release permissions: @@ -22,26 +20,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.base.ref }} + ref: ${{ github.ref_name }} fetch-depth: 0 - - name: Get PR type from description - id: pr-type - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const body = context.payload.pull_request.body || ''; - const typeMatch = body.match(/type:\s*(feat|fix|chore|docs|refactor)/i); - - if (!typeMatch) { - core.setOutput('type', 'fix'); - return; - } - - const type = typeMatch[1].toLowerCase(); - core.setOutput('type', type); - - name: Setup Node uses: actions/setup-node@v4 with: @@ -58,8 +39,6 @@ jobs: - name: Run semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_EVENT_NAME: push - GITHUB_REF: refs/heads/${{ github.event.pull_request.base.ref }} run: npx semantic-release - name: Rewrite notes (cumulative, grouped, since last stable) From 15b52a57bd99f98d039d4563f79747124a259d54 Mon Sep 17 00:00:00 2001 From: Ayush8923 <80516839+Ayush8923@users.noreply.github.com> Date: Wed, 17 Jun 2026 13:04:39 +0530 Subject: [PATCH 3/3] release: remove the Update PR labels steps --- .github/workflows/pre-release.yml | 43 ------------------------------- 1 file changed, 43 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 72581ad..cc41cc2 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -176,46 +176,3 @@ jobs: core.warning(`Could not delete tag ${r.tag_name}: ${e.message}`); } } - - - name: Update PR labels - if: success() - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const prNumber = context.payload.pull_request.number; - - const labelsToCreate = [ - { name: 'released', color: '0075ca' }, - { name: 'released on @main', color: '0052cc' } - ]; - - for (const label of labelsToCreate) { - try { - await github.rest.issues.getLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - name: label.name - }); - } catch { - await github.rest.issues.createLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - name: label.name, - color: label.color - }); - } - } - - await github.rest.issues.removeAllLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber - }); - - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - labels: ['released', 'released on @main'] - });