79 lines
2.0 KiB
YAML
79 lines
2.0 KiB
YAML
name: "Git Auto Comment"
|
|
description: "Automatically post pull request comments or reviews on Gitea or GitHub."
|
|
author: "Charish Patel"
|
|
branding:
|
|
icon: "message-square"
|
|
color: "blue"
|
|
|
|
inputs:
|
|
platform:
|
|
description: "Platform to use (github or gitea)."
|
|
required: false
|
|
default: "github"
|
|
|
|
token:
|
|
description: "API token for authentication."
|
|
required: true
|
|
|
|
repo_owner:
|
|
description: "Repository owner."
|
|
required: true
|
|
|
|
repo_name:
|
|
description: "Repository name."
|
|
required: true
|
|
|
|
pr_index:
|
|
description: "Pull request index or issue number."
|
|
required: true
|
|
|
|
api_url:
|
|
description: "Base API URL (required for Gitea)."
|
|
required: false
|
|
|
|
diff:
|
|
description: "Diff or plan text to include in the comment."
|
|
required: false
|
|
|
|
comment_template:
|
|
description: "Template for comment body. Supports {line} and {lines} placeholders."
|
|
required: false
|
|
default: "Auto-comment: changed line -> {line}"
|
|
|
|
debug:
|
|
description: "Enable verbose debug logging with colorized output."
|
|
required: false
|
|
default: "false"
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Install Python 3
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y python3 python3-venv python3-pip
|
|
|
|
- name: Set up venv and install deps
|
|
shell: bash
|
|
run: |
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
pip install -r ${{ github.action_path }}/requirements.txt
|
|
|
|
- name: Run git-auto-comment
|
|
shell: bash
|
|
env:
|
|
PLATFORM: ${{ inputs.platform }}
|
|
TOKEN: ${{ inputs.token }}
|
|
REPO_OWNER: ${{ inputs.repo_owner }}
|
|
REPO_NAME: ${{ inputs.repo_name }}
|
|
PR_INDEX: ${{ inputs.pr_index }}
|
|
API_URL: ${{ inputs.api_url }}
|
|
DIFF: ${{ inputs.diff }}
|
|
COMMENT_TEMPLATE: ${{ inputs.comment_template }}
|
|
DEBUG: ${{ inputs.debug }}
|
|
run: |
|
|
source venv/bin/activate
|
|
python ${{ github.action_path }}/git-auto-comment.py
|