Fixing PR parsing.
This commit is contained in:
+18
-11
@@ -16,7 +16,7 @@ inputs:
|
|||||||
|
|
||||||
tea-version:
|
tea-version:
|
||||||
description: Tea CLI version
|
description: Tea CLI version
|
||||||
default: 0.10.1
|
default: 0.14.2
|
||||||
|
|
||||||
pr-title:
|
pr-title:
|
||||||
description: Custom title. Defaults to using subject of the most recent commit.
|
description: Custom title. Defaults to using subject of the most recent commit.
|
||||||
@@ -81,15 +81,16 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
echo "Checking for PR... 🔎"
|
|
||||||
pr_number=$(tea pr list \
|
pr_number=$(tea pr list \
|
||||||
--repo ${{ github.repository }} \
|
--repo ${{ github.repository }} \
|
||||||
--state open \
|
--state open \
|
||||||
--fields index,head \
|
--fields index,head \
|
||||||
--output simple \
|
--output simple \
|
||||||
| egrep "${{ github.ref_name }}" \
|
| egrep "${{ github.ref_name }}" \
|
||||||
| awk '{print $1}'\
|
| grep -oE '#[0-9]+' \
|
||||||
| tr -d '#')
|
| head -n1 \
|
||||||
|
| tr -d '#')
|
||||||
|
|
||||||
echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
|
echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Skip PR Creation
|
- name: Skip PR Creation
|
||||||
@@ -140,10 +141,16 @@ runs:
|
|||||||
-a "${{ inputs.assignee }}" \
|
-a "${{ inputs.assignee }}" \
|
||||||
-L "${{ inputs.pr-label }}" \
|
-L "${{ inputs.pr-label }}" \
|
||||||
--output simple \
|
--output simple \
|
||||||
| grep -m1 '#' \
|
| grep -oE '#[0-9]+' \
|
||||||
| awk '{print $1}' \
|
| head -n1 \
|
||||||
| tr -d '#')
|
| tr -d '#')
|
||||||
|
|
||||||
|
if [[ -z "${created_pr_index}" || "${created_pr_index}" != [0-9]* ]]; then
|
||||||
|
echo "::error::Could not parse created PR index from tea output"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
created_pr_url="${{ inputs.url }}/${{ github.repository }}/pulls/${created_pr_index}"
|
created_pr_url="${{ inputs.url }}/${{ github.repository }}/pulls/${created_pr_index}"
|
||||||
|
|
||||||
pr_comments_url="${{ inputs.url }}/api/v1/repos/${{ github.repository }}/issues/${created_pr_index}/comments"
|
pr_comments_url="${{ inputs.url }}/api/v1/repos/${{ github.repository }}/issues/${created_pr_index}/comments"
|
||||||
|
|||||||
Reference in New Issue
Block a user