Default values for inputs; diff is optional.

This commit is contained in:
2025-10-19 10:45:03 -04:00
parent 8f32fb0bb4
commit 81e43bcdf4
+10 -11
View File
@@ -15,18 +15,17 @@ runs:
python-version: "3.11" python-version: "3.11"
- name: Install dependencies - name: Install dependencies
shell: bash
run: pip install requests run: pip install requests
- name: Run PR commenter - name: Run PR commenter
run: python git-auto-comment.py run: python comment_pr_diff.py
shell: python shell: python
env: env:
PLATFORM: ${{ inputs.platform }} PLATFORM: ${{ inputs.platform }}
TOKEN: ${{ inputs.token }} TOKEN: ${{ inputs.token }}
API_URL: ${{ inputs.api_url }} API_URL: ${{ inputs.api_url || github.api_url }}
REPO_OWNER: ${{ inputs.repo_owner }} REPO_OWNER: ${{ inputs.repo_owner || github.repository_owner }}
REPO_NAME: ${{ inputs.repo_name }} REPO_NAME: ${{ inputs.repo_name || github.repository }}
PR_INDEX: ${{ inputs.pr_index }} PR_INDEX: ${{ inputs.pr_index }}
DIFF: ${{ inputs.diff }} DIFF: ${{ inputs.diff }}
COMMENT_TEMPLATE: ${{ inputs.comment_template }} COMMENT_TEMPLATE: ${{ inputs.comment_template }}
@@ -44,21 +43,21 @@ inputs:
required: false required: false
repo_owner: repo_owner:
description: "Repository owner (user/org)" description: "Repository owner (user/org)"
required: true required: false
repo_name: repo_name:
description: "Repository name" description: "Repository name"
required: true required: false
pr_index: pr_index:
description: "PR number (GitHub) or index (Gitea)" description: "PR number (GitHub) or index (Gitea)"
required: true required: true
diff: diff:
description: "Git diff to parse, in standard format (generated via git diff)" description: "Git diff to parse (optional). If empty, posts only a general PR comment."
required: true required: false
comment_template: comment_template:
description: | description: |
Multiline template for comment body. Multiline template for comment body.
Use placeholders: Use placeholders:
- {line} → replaced by single changed line - {line} → replaced by single changed line
- {lines} → replaced by all added lines in the file - {lines} → replaced by all added lines in the file
required: true required: false
default: "Auto-comment: changed line -> {line}" default: "Auto-comment: changed line -> {line}"