Skip to content

Commit

Permalink
ci: bug for cherry pick (#2130)
Browse files Browse the repository at this point in the history
* optimize the log

Signed-off-by: [email protected] <[email protected]>

* optimize the log

Signed-off-by: [email protected] <[email protected]>

* optimize the log

Signed-off-by: [email protected] <[email protected]>

* optimize the log

Signed-off-by: [email protected] <[email protected]>

* ci: bug for cherry pick

Signed-off-by: [email protected] <[email protected]>

* ci: bug for cherry pick

Signed-off-by: [email protected] <[email protected]>

---------

Signed-off-by: [email protected] <[email protected]>
  • Loading branch information
weizhoublue authored Aug 3, 2023
1 parent 548e129 commit ccb48d9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/auto-cherrypick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,20 @@ jobs:
set -x
echo "============ print var ======== "
grep -Eio "Merge pull request #[0-9]+ " <<< "${JSON}" || true
PR_NUMBER=` grep -Eio "Merge pull request #[0-9]+ " <<< "${JSON}" | grep -Eo "[0-9]+" | uniq ` || true
[ -n "${PR_NUMBER}" ] || { echo "no PR number, ignore" ; }
echo "try to get PR from commit"
COMMIT=` echo "${JSON}" | jq '.event.commits[0].id' | tr -d '"' ` || true
if [ -n "${COMMIT}" ]; then
PR_NUMBER=`curl -s -H "Accept: application/vnd.github.groot-preview+json" https://api.github.com/repos/${{ github.repository }}/commits/${COMMIT}/pulls | jq -r '.[].number' `
else
echo "error, failed to get any commit ID"
fi
if [ -z "${PR_NUMBER}" ] ; then
PR_NUMBER=` grep -Eio "Merge pull request #[0-9]+ " <<< "${JSON}" | grep -Eo "[0-9]+" | uniq ` || true
fi
if [ -z "${PR_NUMBER}" ] ; then
echo "error, failed to get PR NUMBER"
exit 1
fi
PR_URL="https://github.com/${{ github.repository }}/pull/${PR_NUMBER}"
ACTION_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
grep '"username":' <<< "${JSON}"
Expand Down

0 comments on commit ccb48d9

Please sign in to comment.