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"
- 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}"