From eb74974dffbf1105fa0f0a0a5de1f187e52b2b2d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Sun, 12 Oct 2025 13:51:25 -0400 Subject: [PATCH] PR title and description inputs. --- README.md | 6 ++++++ action.yml | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 40b88f3..a1e734e 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,12 @@ user: read Tea CLI version (Default: 0.10.1) +### pr-title +Custom title. Defaults to using subject of the most recent commit (`git log -n 1 --format=%s`). + +### pr-description +Custom description. Defaults to using body of the most recent commit (`git log -n 1 --format=%b`). + ### pr-label Issues label for the PR diff --git a/action.yml b/action.yml index 17a1c22..b7f8182 100644 --- a/action.yml +++ b/action.yml @@ -18,6 +18,12 @@ inputs: description: Tea CLI version default: 0.10.1 + pr-title: + description: Custom title. Defaults to using subject of the most recent commit. + + pr-description: + description: Custom description. Defaults to using body of the most recent commit. + pr-label: description: Labels for the PR (comma-separated) @@ -78,9 +84,16 @@ runs: - name: PR Creation shell: bash if: steps.check-opened-pr-step.outputs.exists == '0' + env: + PR_TITLE: ${{ inputs.pr-title }} + PR_DESCRIP: ${{ inputs.pr-description }} run: | - PR_TITLE=$(git log -n 1 --format=%s) - PR_DESCRIP=$(git log -n 1 --format=%b) + if [ -z "${PR_TITLE}" ]; then + PR_TITLE=$(git log -n 1 --format=%s) + fi + if [ -z "${PR_DESCRIP}" ]; then + PR_DESCRIP=$(git log -n 1 --format=%b) + fi tea pr c -r ${{ github.repository }} \ -t "${PR_TITLE}" \ -d "${PR_DESCRIP}" \