Skip to content

Commit 0002d9e

Browse files
authored
Added workflow for creating branches for patch releases (#3192)
This creates a new GitHub action to create a release branch from which additional patch releases can be generated. It takes a version (e.g., `4.1.8`) and produces a new branch off of the base tag (so `4.1.8-release` off of tag `4.1.8.0`). This allows a maintainer to create a patch branch given our relatively restrictive branch protection rules, which generally do not allow for branch creation.
1 parent f08b6f5 commit 0002d9e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/create_branch.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Create Release Branch
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Base version to build off of (format: x.y.z)'
8+
required: true
9+
10+
11+
jobs:
12+
# Simple workflow that creates a release branch off of a given tag.
13+
# Our branch protection rules prevent users from creating branches
14+
# on their own, as we don't want too much clutter. This allows
15+
# maintainers to create a new branch for generating patches when
16+
# necessary.
17+
branch:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
steps:
22+
# Checkout the tag corresponding to patch 0 for the given version
23+
- name: Checkout sources
24+
uses: actions/[email protected]
25+
with:
26+
ssh-key: ${{ secrets.DEPLOY_KEY }}
27+
fetch-tags: true
28+
ref: ${{ inputs.version }}.0
29+
30+
# Create and push the branch
31+
- name: Create Branch
32+
run: git checkout -b ${{ inputs.version }}-release
33+
- name: Push
34+
run: git push -u origin ${{ inputs.version }}-release

0 commit comments

Comments
 (0)