PR Creation step fix.
This commit is contained in:
+16
-10
@@ -123,31 +123,37 @@ runs:
|
|||||||
PR_TITLE: ${{ inputs.pr-title }}
|
PR_TITLE: ${{ inputs.pr-title }}
|
||||||
PR_DESCRIP: ${{ inputs.pr-description }}
|
PR_DESCRIP: ${{ inputs.pr-description }}
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
if [ -z "${PR_TITLE}" ]; then
|
if [ -z "${PR_TITLE}" ]; then
|
||||||
PR_TITLE=$(git log -n 1 --format=%s)
|
PR_TITLE=$(git log -n 1 --format=%s)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${PR_DESCRIP}" ]; then
|
if [ -z "${PR_DESCRIP}" ]; then
|
||||||
PR_DESCRIP=$(git log -n 1 --format=%b)
|
PR_DESCRIP=$(git log -n 1 --format=%b)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
created_pr_index=$(tea pr c -r ${{ github.repository }} \
|
created_pr_index=$(tea pr create \
|
||||||
|
-r ${{ github.repository }} \
|
||||||
-t "${PR_TITLE}" \
|
-t "${PR_TITLE}" \
|
||||||
-d "${PR_DESCRIP}" \
|
-d "${PR_DESCRIP}" \
|
||||||
-a ${{ inputs.assignee }} \
|
-a "${{ inputs.assignee }}" \
|
||||||
-L "${{ inputs.pr-label }}" \
|
-L "${{ inputs.pr-label }}" \
|
||||||
--output simple | awk '{print $1}' | tr -d '#')
|
--output simple \
|
||||||
|
| awk '{print $1}' \
|
||||||
|
| tr -d '#')
|
||||||
|
|
||||||
created_pr_url=$(tea pr ls --state open \
|
created_pr_url="${{ inputs.url }}/${{ github.repository }}/pulls/${created_pr_index}"
|
||||||
-r ${{ github.repository }} \
|
|
||||||
-f index,url \
|
|
||||||
-o simple | grep "^${created_pr_index} " | awk '{print $2}')
|
|
||||||
|
|
||||||
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"
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "created_pr_index=${created_pr_index}"
|
||||||
|
echo "pr_url=${created_pr_url}"
|
||||||
|
echo "pr_comments_url=${pr_comments_url}"
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
echo "PR Created 🎫"
|
echo "PR Created 🎫"
|
||||||
echo "created_pr_index=$created_pr_index" >> $GITHUB_OUTPUT
|
|
||||||
echo "pr_url=$created_pr_url" >> $GITHUB_OUTPUT
|
|
||||||
echo "pr_comments_url=$pr_comments_url" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Set unified PR number output
|
- name: Set unified PR number output
|
||||||
id: set-pr-output
|
id: set-pr-output
|
||||||
|
|||||||
Reference in New Issue
Block a user