From acfc22822c674b164996887755e5f1e9b9d93ff8 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 6 Nov 2020 15:02:55 -0500 Subject: [PATCH] ci: cherry-pick port-merge comment --- .circleci/scripts/cherry-picker.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.circleci/scripts/cherry-picker.sh b/.circleci/scripts/cherry-picker.sh index f6ce0bc431..ae4e24b0fa 100755 --- a/.circleci/scripts/cherry-picker.sh +++ b/.circleci/scripts/cherry-picker.sh @@ -131,6 +131,16 @@ fi # save PR number pr_number=$(echo "$resp" | jq '.items[].number') +# comment on the PR with the build number to make it easy to re-run the job when +# cherry-pick labels are added in the future +github_message=":cherries: Starting backport cherry picking.\n\nTo cherry-pick post-merge, add backport labels and re-run ${CIRCLE_BUILD_URL}." +curl -f -s -H "Authorization: token ${GITHUB_TOKEN}" \ + -X POST \ + -d "{ \"body\": \"${github_message}\"}" \ + "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/issues/${pr_number}/comments" + + + # If the API returned a non-zero count, we have found a PR with that commit so we find # the labels from the PR