From 7c1d36bad5f083fc23ba2503ba470bcb38e5dafd Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Oct 2023 12:04:20 +0200 Subject: [PATCH 1/4] fix prerelease -> non-patch naming --- .github/workflows/prepare-non-patch-release.yml | 6 +++--- CONTRIBUTING/RELEASING.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prepare-non-patch-release.yml b/.github/workflows/prepare-non-patch-release.yml index ea72d924d918..e1a443ff8025 100644 --- a/.github/workflows/prepare-non-patch-release.yml +++ b/.github/workflows/prepare-non-patch-release.yml @@ -1,5 +1,5 @@ -name: Prepare prerelease PR -run-name: Prepare prerelease PR, triggered by ${{ github.triggering_actor }} +name: Prepare non-patch PR +run-name: Prepare non-patch PR, triggered by ${{ github.triggering_actor }} on: push: @@ -35,7 +35,7 @@ concurrency: jobs: prepare-non-patch-pull-request: - name: Prepare prerelease pull request + name: Prepare non-patch pull request runs-on: ubuntu-latest environment: release defaults: diff --git a/CONTRIBUTING/RELEASING.md b/CONTRIBUTING/RELEASING.md index e92fa8fa36a3..7cf29a463c62 100644 --- a/CONTRIBUTING/RELEASING.md +++ b/CONTRIBUTING/RELEASING.md @@ -304,7 +304,7 @@ The workflows can be triggered here: - [Prepare next PR](https://github.com/storybookjs/storybook/actions/workflows/prepare-non-patch-release.yml) - [Prepare patch PR](https://github.com/storybookjs/storybook/actions/workflows/prepare-patch-release.yml) -Crucially for prereleases, this is also where you change the versioning strategy if you need something else than the default as described in [Preparing - Non-patch Releases](#non-patch-releases). When triggering the prerelease workflow manually, you can optionally add inputs: +Crucially for prereleases, this is also where you change the versioning strategy if you need something else than the default as described in [Preparing - Non-patch Releases](#non-patch-releases). When triggering the non-patch workflow manually, you can optionally add inputs: ![Screenshot of triggering the non-patch-release workflow in GitHub Actions, with a form that shows a release type selector and a prerelease identifier text field](prerelease-workflow-inputs.png) From 663f9c9c3662de89e1bcfab7f8fe8fbf95911ca6 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Oct 2023 13:38:16 +0200 Subject: [PATCH 2/4] improve merge conflict hnadling between next and latest-release --- .github/workflows/prepare-non-patch-release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prepare-non-patch-release.yml b/.github/workflows/prepare-non-patch-release.yml index e1a443ff8025..6e89369c7c7c 100644 --- a/.github/workflows/prepare-non-patch-release.yml +++ b/.github/workflows/prepare-non-patch-release.yml @@ -133,11 +133,13 @@ jobs: git push --force origin version-non-patch-from-${{ steps.bump-version.outputs.current-version }} - name: Resolve merge-conflicts with base branch - if: steps.is-prerelease.outputs.prerelease == 'true' + if: steps.is-prerelease.outputs.prerelease == 'false' + working-directory: . env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git pull origin latest-release + git config pull.rebase false + git pull --no-commit --no-ff origin latest-release git checkout --ours . git add . git commit -m "Merge latest-release into version-non-patch-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]" From e73263bc7dea6e634fbf35ed5b9092fc544627b6 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Oct 2023 13:44:06 +0200 Subject: [PATCH 3/4] make merge conflict handling more resilient --- .github/workflows/prepare-non-patch-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prepare-non-patch-release.yml b/.github/workflows/prepare-non-patch-release.yml index 6e89369c7c7c..58f2b3e81aa1 100644 --- a/.github/workflows/prepare-non-patch-release.yml +++ b/.github/workflows/prepare-non-patch-release.yml @@ -139,10 +139,10 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config pull.rebase false - git pull --no-commit --no-ff origin latest-release + git pull --no-commit --no-ff origin latest-release || true git checkout --ours . git add . - git commit -m "Merge latest-release into version-non-patch-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]" + git commit --amend -m "Merge latest-release into version-non-patch-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]" - name: Generate PR description id: description From ee76097a7c98d53c93b9e4292d88b1dbd2fa1c57 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Oct 2023 13:47:27 +0200 Subject: [PATCH 4/4] fix merging commit message --- .github/workflows/prepare-non-patch-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prepare-non-patch-release.yml b/.github/workflows/prepare-non-patch-release.yml index 58f2b3e81aa1..bc14a9b68e79 100644 --- a/.github/workflows/prepare-non-patch-release.yml +++ b/.github/workflows/prepare-non-patch-release.yml @@ -142,7 +142,7 @@ jobs: git pull --no-commit --no-ff origin latest-release || true git checkout --ours . git add . - git commit --amend -m "Merge latest-release into version-non-patch-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]" + git commit --no-verify -m "Merge latest-release into version-non-patch-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]" - name: Generate PR description id: description