110 lines
3.4 KiB
YAML
110 lines
3.4 KiB
YAML
name: "Wait For Manual Approval (Gitea/GitHub + Apprise)"
|
|
description: >
|
|
Pauses workflow until designated approvers comment (or react) with approval or denial keywords,
|
|
optionally posts an initial comment, auto-closes the issue, and provides outputs:
|
|
approval_status, issue_number, issue_url.
|
|
|
|
inputs:
|
|
token:
|
|
description: "API token for GitHub or Gitea (GITHUB_TOKEN or a personal token)"
|
|
required: true
|
|
|
|
api_url:
|
|
description: "Root API URL (e.g., https://git.example.com/api/v1 or https://api.github.com)"
|
|
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 (e.g. ops-team,john.doe)"
|
|
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"
|
|
|
|
enable_reactions:
|
|
description: "Enable reaction-based approvals (:+1: / -1). Default true"
|
|
default: "true"
|
|
|
|
poll_interval:
|
|
description: "Seconds between each comment/reaction check"
|
|
default: "10"
|
|
|
|
reminder_interval:
|
|
description: "Seconds between reminders (0 disables reminders)"
|
|
default: "0"
|
|
|
|
apprise_api_url:
|
|
description: "URL to Apprise API (optional; e.g. https://apprise.example.com)"
|
|
required: false
|
|
default: ""
|
|
|
|
initial_comment:
|
|
description: "Optional comment to post immediately on the newly created/reused issue (supports markdown)"
|
|
required: false
|
|
default: ""
|
|
|
|
auto_close:
|
|
description: "Auto-close the issue once a final decision has been reached (true/false)"
|
|
default: "true"
|
|
|
|
issue_title:
|
|
description: "Optional issue title. If empty the action generates a default title."
|
|
required: false
|
|
default: ""
|
|
|
|
outputs:
|
|
approval_status:
|
|
description: "Final approval status: approved or denied"
|
|
value: ${{ steps.wait.outputs.approval_status }}
|
|
|
|
issue_number:
|
|
description: "The issue number that was used"
|
|
value: ${{ steps.wait.outputs.issue_number }}
|
|
|
|
issue_url:
|
|
description: "A URL to the approval issue"
|
|
value: ${{ steps.wait.outputs.issue_url }}
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Make helper scripts executable
|
|
shell: bash
|
|
run: |
|
|
chmod +x "$GITHUB_ACTION_PATH/wait-for-approval.sh" "$GITHUB_ACTION_PATH/notify"
|
|
|
|
- name: Wait for manual approval
|
|
id: wait
|
|
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 }}
|
|
ENABLE_REACTIONS: ${{ inputs.enable_reactions }}
|
|
POLL_INTERVAL: ${{ inputs.poll_interval }}
|
|
REMINDER_INTERVAL: ${{ inputs.reminder_interval }}
|
|
APPRISE_API_URL: ${{ inputs.apprise_api_url }}
|
|
INITIAL_COMMENT: ${{ inputs.initial_comment }}
|
|
AUTO_CLOSE: ${{ inputs.auto_close }}
|
|
ISSUE_TITLE: ${{ inputs.issue_title }}
|
|
run: |
|
|
# The script will write outputs directly to $GITHUB_OUTPUT:
|
|
# approval_status, issue_number, issue_url
|
|
bash "$GITHUB_ACTION_PATH/wait-for-approval.sh"
|