Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update cherry pick to 11 #2966

Merged
merged 2 commits into from
Jan 6, 2025
Merged
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
8 changes: 5 additions & 3 deletions .github/workflows/cherry-pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types:
- closed
branches:
- 7.x.x
- 11.x.x

env:
TARGET_BRANCH: main
Expand Down Expand Up @@ -38,6 +38,7 @@ jobs:
run: npm ci

- name: Cherry pick
id: cherry-pick
run: |
# Set the git user to the author of the merge commit.
git config user.name "$(git log -1 --pretty=format:'%an' ${{ github.event.pull_request.merge_commit_sha }})"
Expand Down Expand Up @@ -73,7 +74,7 @@ jobs:
exit 0
fi

echo "COMMIT_MESSAGE='$(git log -1 --pretty=%s | sed -e "s/'/\\\\'/g")'" >> $GITHUB_ENV
echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

Expand All @@ -83,6 +84,7 @@ jobs:
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
script: |
const pr = context.payload.pull_request;
const title = ${{ toJson(steps.cherry-pick.outputs.commit_message) }};
let body = `:cherries: Cherry picked from #${pr.number} [${pr.title}](${pr.html_url})`
const prAzureBoardLink = pr.body?.match(/(?<=\[)AB#\d+(?=])/g);
if (prAzureBoardLink) {
Expand All @@ -93,7 +95,7 @@ jobs:
repo: context.repo.repo,
head: process.env.CHERRY_PICK_BRANCH,
base: process.env.TARGET_BRANCH,
title: process.env.COMMIT_MESSAGE,
title,
body
}).then(result => {
console.log(`Created PR #${result.data.number}: ${result.data.html_url}`);
Expand Down
Loading