-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(branch strategy): rename release branch to next
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
Showing
2 changed files
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters