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: fix cherry pick #292

Merged
merged 1 commit into from
Aug 3, 2023
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
17 changes: 14 additions & 3 deletions .github/workflows/auto-cherrypick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,20 @@ jobs:
run: |
set -x
echo "============ print var ======== "
grep -Eio "Merge pull request #[0-9]+ " <<< "${JSON}"
PR_NUMBER=` grep -Eio "Merge pull request #[0-9]+ " <<< "${JSON}" | grep -Eo "[0-9]+" | uniq `
[ -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
Loading