65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
name: "PR Commenter Diff-Aware"
|
|
description: "Post comments to changed lines in a PR based on a git diff, for GitHub or Gitea. Supports multiline templates."
|
|
author: "Trez.One"
|
|
|
|
branding:
|
|
icon: "paperclip"
|
|
color: "blue"
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: pip install requests
|
|
|
|
- name: Run PR commenter
|
|
run: python git-auto-comment.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 }}
|
|
PR_INDEX: ${{ inputs.pr_index }}
|
|
DIFF: ${{ inputs.diff }}
|
|
COMMENT_TEMPLATE: ${{ inputs.comment_template }}
|
|
|
|
inputs:
|
|
platform:
|
|
description: "Target platform: github or gitea"
|
|
required: true
|
|
default: "github"
|
|
token:
|
|
description: "API token for authentication"
|
|
required: true
|
|
api_url:
|
|
description: "Gitea API URL (only required for Gitea, e.g., https://gitea.example.com/api/v1)"
|
|
required: false
|
|
repo_owner:
|
|
description: "Repository owner (user/org)"
|
|
required: true
|
|
repo_name:
|
|
description: "Repository name"
|
|
required: true
|
|
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
|
|
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}"
|