Skip to content

Commit

Permalink
fixed the auto-cherry-picking issue cause due git-hub action failure
Browse files Browse the repository at this point in the history
  • Loading branch information
omkarkhatavkar committed Feb 8, 2024
1 parent 1c4a1a7 commit 90d7235
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/auto_cherry_pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,24 @@ jobs:
})
- name: Check if cherrypick pr is created
uses: juliangruber/find-pull-request-action@v1
id: fpr
id: search_pr
if: always()
with:
branch: "cherry-pick-${{ matrix.label }}-${{ github.sha }}"
base: ${{ matrix.label }}
run: |
PR_TITLE="[${{ matrix.label }}] ${{ github.event.inputs.pr_title }}"
API_URL="https://api.github.com/repos/${{ github.repository }}/pulls?state=open"
PR_SEARCH_RESULT=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$API_URL" | jq --arg title "$PR_TITLE" '.[] | select(.title == $title)')
if [ -n "$PR_SEARCH_RESULT" ]; then
echo "pr_found=true" >> $GITHUB_OUTPUT
echo "PR is Found with title $PR_TITLE"
else
echo "pr_found=false" >> $GITHUB_OUTPUT
echo "PR is not Found with title $PR_TITLE"
fi
## Failure Logging to issues and GChat Group
- name: Create Github issue on cherrypick failure
id: create-issue
if: ${{ always() && steps.fpr.outputs.number != '' && steps.cherrypick.outcome != 'success' && startsWith(matrix.label, '6.') && matrix.label != github.base_ref }}
if: ${{ always() && steps.search_pr.outputs.pr_found == 'true' && steps.cherrypick.outcome != 'success' && startsWith(matrix.label, '6.') && matrix.label != github.base_ref }}
uses: dacbd/create-issue-action@main
with:
token: ${{ secrets.CHERRYPICK_PAT }}
Expand Down

0 comments on commit 90d7235

Please sign in to comment.