Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/cherry-pick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Cherry-Pick PRs to Master

on:
pull_request:
types:
- closed

jobs:
get_labels:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Get Merged PR Labels.
id: merged_pr
run: |
PR_NUMBER=$(jq -r '.pull_request.number' "$GITHUB_EVENT_PATH")
ACCESS_TOKEN="${{ secrets.GITHUB_TOKEN }}"
LABELS=$(curl -s -H "Authorization: Bearer $ACCESS_TOKEN" "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | jq -r '.labels[].name')
echo "Labels12: $LABELS"

# Fetch PR branch
git fetch origin pull/${PR_NUMBER}/head:pr-${PR_NUMBER}

# Check out the release branch
git checkout release-1

# Cherry-pick the PR commit(s)
git cherry-pick pr-${PR_NUMBER}

# Create a new pull request
gh pr create --base release-1 --head pr-${PR_NUMBER} --title "Cherry-pick PR ${PR_NUMBER}" --body "Cherry-picking changes from PR ${PR_NUMBER}."

1 change: 1 addition & 0 deletions pr-222
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pr222
1 change: 1 addition & 0 deletions pr-test1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pr-test5