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.
0 commit comments