This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new ddce71f705d0 Document adding force push prevention for a new branch
ddce71f705d0 is described below

commit ddce71f705d0fd09837aaba3decf66720a5163e4
Author: Lari Hotari <[email protected]>
AuthorDate: Wed Oct 16 07:13:02 2024 +0300

    Document adding force push prevention for a new branch
---
 contribute/release-process.md | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/contribute/release-process.md b/contribute/release-process.md
index 1d751e7e504a..07f063ba6f0b 100644
--- a/contribute/release-process.md
+++ b/contribute/release-process.md
@@ -936,6 +936,19 @@ git commit -a -s -m "[cleanup][build] Bumped version to 
3.Y.0-SNAPSHOT'
 
 Since this needs to be merged into `master`, you need to follow the regular 
process and create a Pull Request on GitHub.
 
+For feature releases, since a new branch is created for the release, the new 
branch needs to be protected against force pushes to prevent corrupting the 
commit history. This is done by adding a rule to the branch protection settings 
for the new branch in `.asf.yaml`.
+
+```yaml
+export RELEASE_BRANCH="branch-X.Y"
+# use yq to add the new branch to the .asf.yaml file
+yq -i '.github.protected_branches[strenv(RELEASE_BRANCH)]={}' .asf.yaml
+# commit the change to .asf.yaml
+git add .asf.yaml
+git commit -m "[improve][ci] Protect $RELEASE_BRANCH from force pushes'
+```
+
+This will prevent force pushing to the release branch, which is important to 
maintain the integrity of the commit history.
+
 ### For maintenance branches
 
 After the release process, you should bump the project version and append it 
with `-SNAPSHOT`.

Reply via email to