Skip to content

Commit

Permalink
ci: fix branch creation and mergify file (#4391)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Oct 19, 2024
1 parent ca46453 commit 5229080
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ create-next-release: prepare-next-release create-prs-next-release
.PHONY: update-labels
update-labels:
echo ' - name: backport patches to $(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) branch' >> ../.mergify.yml
echo ' conditions:' >> ../.mergify.yml
echo ' - merged' >> ../.mergify.yml
echo ' - base=main' >> ../.mergify.yml
echo ' - label=backport-$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION)' >> .mergify.yml
echo ' actions:' >> ../.mergify.yml
echo ' backport:' >> ../.mergify.yml
echo ' assignees:' >> ../.mergify.yml
echo ' - "{{ author }}"' >> ../.mergify.yml
echo ' labels:' >> ../.mergify.yml
echo ' - "backport"' >> ../.mergify.yml
echo ' branches:' >> ../.mergify.yml
echo ' - "$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION)"' >> ../.mergify.yml
echo ' conditions:' >> ../.mergify.yml
echo ' - merged' >> ../.mergify.yml
echo ' - label=backport-$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION)' >> ../.mergify.yml
echo ' actions:' >> ../.mergify.yml
echo ' backport:' >> ../.mergify.yml
echo ' assignees:' >> ../.mergify.yml
echo ' - "{{ author }}"' >> ../.mergify.yml
echo ' labels:' >> ../.mergify.yml
echo ' - "backport"' >> ../.mergify.yml
echo ' branches:' >> ../.mergify.yml
echo ' - "$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION)"' >> ../.mergify.yml
echo ' title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"' >> ../.mergify.yml

## @help:prepare-major-minor-release:Prepare a major/minor release by creating a new branch reference.
.PHONY: prepare-major-minor-release
prepare-major-minor-release:
git checkout 8.x
git checkout -b $(RELEASE_BRANCH)

## @help:create-branch-major-minor-release:Pushes the changes on the project folder to the new RELEASE_BRANCH.
Expand All @@ -68,6 +68,7 @@ create-branch-major-minor-release:
## @help:prepare-next-release:Prepare the original branch for the next release cycle.
.PHONY: prepare-next-release
prepare-next-release:
git checkout main
git checkout -b $(BACKPORT_BRANCH_NAME)
$(MAKE) update-labels
$(MAKE) git-diff
Expand All @@ -85,7 +86,7 @@ create-prs-next-release:
gh pr create \
--title "backport: Add backport-$(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) label" \
--body "Merge as soon as $(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) branch was created." \
--base 8.x \
--base main \
--label 'Team:Automation' || echo "There are no changes"

## Diff output
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/run-minor-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# as long as we are using 8.x we need to fetch main and 8.x branches
fetch-depth: 0

- name: Set github config
run: |
Expand Down

0 comments on commit 5229080

Please sign in to comment.