Revamp.
This commit is contained in:
+44
-14
@@ -1,13 +1,16 @@
|
||||
name: "Wait For Manual Approval (Gitea/GitHub + Apprise)"
|
||||
description: "Pauses workflow until designated approvers comment with approval or denial keywords."
|
||||
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"
|
||||
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)"
|
||||
description: "Root API URL (e.g., https://git.example.com/api/v1 or https://api.github.com)"
|
||||
required: true
|
||||
|
||||
repo_owner:
|
||||
@@ -19,7 +22,7 @@ inputs:
|
||||
required: true
|
||||
|
||||
approvers:
|
||||
description: "Comma-separated list of approver usernames"
|
||||
description: "Comma-separated list of approver usernames (e.g. ops-team,john.doe)"
|
||||
required: true
|
||||
|
||||
approval_keywords:
|
||||
@@ -30,8 +33,12 @@ inputs:
|
||||
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 check"
|
||||
description: "Seconds between each comment/reaction check"
|
||||
default: "10"
|
||||
|
||||
reminder_interval:
|
||||
@@ -39,28 +46,47 @@ inputs:
|
||||
default: "0"
|
||||
|
||||
apprise_api_url:
|
||||
description: "URL to Apprise API (optional)"
|
||||
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 issue"
|
||||
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-for-manual-approval.outputs.approval_status }}
|
||||
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 scripts executable
|
||||
- name: Make helper scripts executable
|
||||
shell: bash
|
||||
run: chmod +x "$GITHUB_ACTION_PATH/wait-for-approval.sh" "$GITHUB_ACTION_PATH/notify"
|
||||
run: |
|
||||
chmod +x "$GITHUB_ACTION_PATH/wait-for-approval.sh" "$GITHUB_ACTION_PATH/notify"
|
||||
|
||||
- name: Run wait-for-approval
|
||||
id: wait-for-manual-approval
|
||||
- name: Wait for manual approval
|
||||
id: wait
|
||||
shell: bash
|
||||
env:
|
||||
TOKEN: ${{ inputs.token }}
|
||||
@@ -70,10 +96,14 @@ runs:
|
||||
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: |
|
||||
status=$(bash "$GITHUB_ACTION_PATH/wait-for-approval.sh")
|
||||
echo "approval_status=$status" >> "$GITHUB_OUTPUT"
|
||||
# The script will write outputs directly to $GITHUB_OUTPUT:
|
||||
# approval_status, issue_number, issue_url
|
||||
bash "$GITHUB_ACTION_PATH/wait-for-approval.sh"
|
||||
|
||||
Reference in New Issue
Block a user