Skip to content

Commit 759b969

Browse files
committed
Add workflows for automatic PRs on release-fix and release-integration branches
1 parent d72fbde commit 759b969

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
##
2+
# Workflow: release-fix auto PR
3+
# Purpose: When a `release-fix/*` branch is created, automatically
4+
# open a pull request targeting the corresponding `release/<version>` branch.
5+
# Maintainer: Android Team - Release Engineering
6+
# Docs: See repository CONTRIBUTING.md for release process guidance
7+
##
8+
name: Auto PR to merge release-fix branches into release
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
on:
15+
create:
16+
17+
jobs:
18+
create-pr:
19+
if: >
20+
github.event.ref_type == 'branch' &&
21+
startsWith(github.event.ref, 'release-fix/')
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Compute target release version
28+
id: compute_version
29+
run: |
30+
BRANCH_NAME="${{ github.event.ref }}"
31+
if [[ "$BRANCH_NAME" =~ ^release-fix/(.+)$ ]]; then
32+
VERSION="${BASH_REMATCH[1]}"
33+
echo "version=$VERSION" >> $GITHUB_OUTPUT
34+
echo "Computed version: $VERSION"
35+
else
36+
echo "Failed to compute version from branch: $BRANCH_NAME"
37+
exit 1
38+
fi
39+
40+
- name: Create Pull Request
41+
uses: peter-evans/create-pull-request@v8
42+
with:
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
base: ${{ format('release/{0}', steps.compute_version.outputs.version) }}
45+
branch: ${{ github.event.ref }}
46+
title: ${{ format('Auto PR: {0} → release/{1}', github.event.ref, steps.compute_version.outputs.version) }}
47+
body: |
48+
This is an automated pull request created to integrate release changes into **release/${{ steps.compute_version.outputs.version }}**.
49+
Triggered when the branch **${{ github.event.ref }}** was published.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
##
2+
# Workflow: release-integration auto PR
3+
# Purpose: When a `release-integration/*` branch is created, automatically
4+
# open a pull request targeting `dev` to integrate release changes.
5+
##
6+
name: Auto PR to dev for release-integration branches
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
on:
13+
create:
14+
15+
jobs:
16+
create-pr:
17+
if: >
18+
github.event.ref_type == 'branch' &&
19+
startsWith(github.event.ref, 'release-integration/')
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Create Pull Request
26+
uses: peter-evans/create-pull-request@v8
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
base: dev
30+
branch: ${{ github.event.ref }}
31+
title: "Auto PR: ${{ github.event.ref }} → dev"
32+
body: |
33+
This is an automated pull request created to integrate release changes into **dev**.
34+
Triggered when the branch **${{ github.event.ref }}** was published.

0 commit comments

Comments
 (0)