80 lines
2.3 KiB
YAML
80 lines
2.3 KiB
YAML
name: "Wait For Manual Approval (Gitea/GitHub + Apprise)"
|
|
description: "Pauses workflow until designated approvers comment with approval or denial keywords."
|
|
|
|
inputs:
|
|
token:
|
|
description: "API token for GitHub or Gitea"
|
|
required: true
|
|
|
|
api_url:
|
|
description: "Root API URL (e.g., https://git.example.com/api/v1)"
|
|
required: true
|
|
|
|
repo_owner:
|
|
description: "Repository owner/org"
|
|
required: true
|
|
|
|
repo_name:
|
|
description: "Repository name"
|
|
required: true
|
|
|
|
approvers:
|
|
description: "Comma-separated list of approver usernames"
|
|
required: true
|
|
|
|
approval_keywords:
|
|
description: "Comma-separated keywords meaning APPROVED"
|
|
default: "approve,approved,yes,lgtm"
|
|
|
|
denial_keywords:
|
|
description: "Comma-separated keywords meaning DENIED"
|
|
default: "deny,denied,no"
|
|
|
|
poll_interval:
|
|
description: "Seconds between each comment check"
|
|
default: "10"
|
|
|
|
reminder_interval:
|
|
description: "Seconds between reminders (0 disables reminders)"
|
|
default: "0"
|
|
|
|
apprise_api_url:
|
|
description: "URL to Apprise API (optional)"
|
|
required: false
|
|
|
|
initial_comment:
|
|
description: "Optional comment to post immediately on the newly created issue"
|
|
required: false
|
|
default: ""
|
|
|
|
outputs:
|
|
approval_status:
|
|
description: "Final approval status: approved or denied"
|
|
value: ${{ steps.wait-for-manual-approval.outputs.approval_status }}
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Make scripts executable
|
|
shell: bash
|
|
run: chmod +x "$GITHUB_ACTION_PATH/wait-for-approval.sh" "$GITHUB_ACTION_PATH/notify"
|
|
|
|
- name: Run wait-for-approval
|
|
id: wait-for-manual-approval
|
|
shell: bash
|
|
env:
|
|
TOKEN: ${{ inputs.token }}
|
|
API_URL: ${{ inputs.api_url }}
|
|
REPO_OWNER: ${{ inputs.repo_owner }}
|
|
REPO_NAME: ${{ inputs.repo_name }}
|
|
APPROVERS: ${{ inputs.approvers }}
|
|
APPROVAL_KEYWORDS: ${{ inputs.approval_keywords }}
|
|
DENIAL_KEYWORDS: ${{ inputs.denial_keywords }}
|
|
POLL_INTERVAL: ${{ inputs.poll_interval }}
|
|
REMINDER_INTERVAL: ${{ inputs.reminder_interval }}
|
|
APPRISE_API_URL: ${{ inputs.apprise_api_url }}
|
|
INITIAL_COMMENT: ${{ inputs.initial_comment }}
|
|
run: |
|
|
status=$(bash "$GITHUB_ACTION_PATH/wait-for-approval.sh")
|
|
echo "approval_status=$status" >> "$GITHUB_OUTPUT"
|