From 81e43bcdf4b7db9647546387cf0ed8e789e15b6f Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Sun, 19 Oct 2025 10:45:03 -0400 Subject: [PATCH] Default values for inputs; diff is optional. --- action.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/action.yml b/action.yml index 0c94301..f979933 100644 --- a/action.yml +++ b/action.yml @@ -15,18 +15,17 @@ runs: python-version: "3.11" - name: Install dependencies - shell: bash run: pip install requests - name: Run PR commenter - run: python git-auto-comment.py + run: python comment_pr_diff.py shell: python env: PLATFORM: ${{ inputs.platform }} TOKEN: ${{ inputs.token }} - API_URL: ${{ inputs.api_url }} - REPO_OWNER: ${{ inputs.repo_owner }} - REPO_NAME: ${{ inputs.repo_name }} + API_URL: ${{ inputs.api_url || github.api_url }} + REPO_OWNER: ${{ inputs.repo_owner || github.repository_owner }} + REPO_NAME: ${{ inputs.repo_name || github.repository }} PR_INDEX: ${{ inputs.pr_index }} DIFF: ${{ inputs.diff }} COMMENT_TEMPLATE: ${{ inputs.comment_template }} @@ -44,21 +43,21 @@ inputs: required: false repo_owner: description: "Repository owner (user/org)" - required: true + required: false repo_name: description: "Repository name" - required: true + required: false pr_index: description: "PR number (GitHub) or index (Gitea)" required: true diff: - description: "Git diff to parse, in standard format (generated via git diff)" - required: true + description: "Git diff to parse (optional). If empty, posts only a general PR comment." + required: false comment_template: description: | Multiline template for comment body. Use placeholders: - {line} → replaced by single changed line - {lines} → replaced by all added lines in the file - required: true - default: "Auto-comment: changed line -> {line}" + required: false + default: "Auto-comment: changed line -> {line}" \ No newline at end of file