Skip to content

Commit

Permalink
fix(branch strategy): rename release branch to next
Browse files Browse the repository at this point in the history
from a conversation with Tobbe. if we name the release branch "release", we can't use the slashes in the release branches anymore because git doesn't allow "release" and "release/minor/etc"
  • Loading branch information
jtoar committed Oct 5, 2022
1 parent a92d0fc commit 5bd39ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/cherry-pick-into-release-branch.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# When a PR is merged into the main branch, this workflow tries to cherry pick the squashed commit into the release branch
# by fast forwarding the release branch via the `--ff` option.
# If that doesn't work (i.e. main and release have diverged), it'll open a PR against the release branch with the squashed commit.
# When a PR is merged into the main branch, this workflow tries to cherry pick the squashed commit into the next branch
# by fast forwarding the next branch via the `--ff` option.
# If that doesn't work (i.e. main and next have diverged), it'll open a PR against the next branch with the squashed commit.

name: 🍒 Cherry pick into release branch
name: 🍒 Cherry pick into next branch

on:
pull_request_target:
Expand All @@ -20,10 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: release
ref: next
# git isn't able to work with $GITHUB_SHA if we don't checkout everything.
fetch-depth: 0
# Since release is a protected branch, we need a token to run `git push` later.
# Since next is a protected branch, we need a token to run `git push` later.
token: ${{ secrets.JTOAR_TOKEN }}

- name: ⏩ Cherry pick fast forward
Expand All @@ -34,18 +34,18 @@ jobs:
git cherry-pick --ff $GITHUB_SHA
# If the HEAD of main and release point to the same commit, then the fast forward worked and we can go ahead and push.
# If the HEAD of main and next point to the same commit, then the fast forward worked and we can go ahead and push.
if [[ "$(git rev-parse origin/main)" = "$(git rev-parse release)" ]]; then
if [[ "$(git rev-parse origin/main)" = "$(git rev-parse next)" ]]; then
git push
else
exit 1
fi
cherry-pick-into-release-pr:
cherry-pick-into-next-pr:
needs: cherry-pick-fast-forward
if: failure()
name: Cherry pick into release PR
name: Cherry pick into next PR
runs-on: ubuntu-latest

steps:
Expand All @@ -60,11 +60,11 @@ jobs:
with:
fetch-depth: 0

- name: Cherry pick into release PR
- name: Cherry pick into next PR
uses: carloscastrojumo/[email protected]
with:
# We specify a token because we want other workflows (like CI) to run on this PR.
# If we omit this, it uses the default token (GITHUB_TOKEN) which doesn't trigger other workflows.
token: ${{ steps.generate_token.outputs.token }}
branch: release
branch: next
labels: cherry-pick
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,14 @@ jobs:

cherry-pick:
needs: [build-lint-test, tutorial-e2e, smoke-test]
if: github.event.pull_request.user.login == 'redwoodjs-bot[bot]' && github.base_ref == 'release' && !contains(join(needs.*.result, ','), 'failure')
if: github.event.pull_request.user.login == 'redwoodjs-bot[bot]' && github.base_ref == 'next' && !contains(join(needs.*.result, ','), 'failure')
name: cherry-pick
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: release
ref: next
fetch-depth: 0
token: ${{ secrets.JTOAR_TOKEN }}

Expand Down Expand Up @@ -353,14 +353,14 @@ jobs:
cherry-pick-docs:
needs: [build-lint-test-docs, tutorial-e2e-docs, smoke-test-docs]
if: github.event.pull_request.user.login == 'redwoodjs-bot[bot]' && github.base_ref == 'release' && !contains(join(needs.*.result, ','), 'failure')
if: github.event.pull_request.user.login == 'redwoodjs-bot[bot]' && github.base_ref == 'next' && !contains(join(needs.*.result, ','), 'failure')
name: cherry-pick-docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: release
ref: next
fetch-depth: 0
token: ${{ secrets.JTOAR_TOKEN }}

Expand Down

0 comments on commit 5bd39ec

Please sign in to comment.