-
Notifications
You must be signed in to change notification settings - Fork 2k
40 lines (36 loc) · 1.39 KB
/
cherry-pick.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: "Cherry-pick dependencies to release branch"
on:
pull_request:
branches:
- main
types: ["closed"]
permissions:
contents: read
jobs:
cherry_pick_to_release:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-24.04
name: Cherry pick into release branch
if: ${{ (contains(github.event.pull_request.labels.*.name, 'dependencies') || contains(github.event.pull_request.labels.*.name, 'needs cherry pick')) && github.event.pull_request.merged == true }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
token: ${{ secrets.NGINX_PAT }}
- name: Set release branch variable
id: branch
run: |
branch=$(git branch -a | egrep '^\s+remotes/origin/release' | awk '{print $1}' | sort -u | tail -n 1)
release_branch=$(basename ${branch})
echo "branch=${release_branch}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Cherry pick into ${{ steps.branch.outputs.branch }}
uses: carloscastrojumo/github-cherry-pick-action@503773289f4a459069c832dc628826685b75b4b3 # v1.0.10
with:
branch: ${{ steps.branch.outputs.branch }}
token: ${{ secrets.NGINX_PAT }}
author: nginx-bot <[email protected]>
title: "[cherry-pick] {old_title}"