dispatch-workflow.sh: piiloriippuvuudet pois — GITEA_API_URL ja GITEA_TOKEN nyt explicit parametreina
CI / load-config (push) Successful in 12s
ci-bats Bats tests
ci-cucumber Cucumber tests FAILED
CI / feature (push) Failing after 1m8s
CI / main (push) Has been skipped

This commit is contained in:
moilanik
2026-06-13 16:01:45 +03:00
parent a7b5917309
commit 957bf150a6
4 changed files with 33 additions and 30 deletions
+5 -4
View File
@@ -1,20 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
[ -z "${GITEA_API_URL:-}" ] && echo "ERROR: GITEA_API_URL is not set" >&2 && exit 1
[ -z "${GITEA_TOKEN:-}" ] && echo "ERROR: GITEA_TOKEN is not set" >&2 && exit 1
TARGET_REPO="${1:-}"
WORKFLOW_FILE="${2:-}"
REF="${3:-}"
INPUTS_JSON="${4:-}"
TIMEOUT_MINUTES="${5:-360}"
GITEA_API_URL="${5:-}"
GITEA_TOKEN="${6:-}"
TIMEOUT_MINUTES="${7:-360}"
POLL_INTERVAL="${DISPATCH_POLL_INTERVAL:-10}"
[ -z "$TARGET_REPO" ] && echo "ERROR: target_repo argument is required" >&2 && exit 1
[ -z "$WORKFLOW_FILE" ] && echo "ERROR: workflow_file argument is required" >&2 && exit 1
[ -z "$REF" ] && echo "ERROR: ref argument is required" >&2 && exit 1
[ -z "$INPUTS_JSON" ] && echo "ERROR: inputs_json argument is required" >&2 && exit 1
[ -z "$GITEA_API_URL" ] && echo "ERROR: gitea_api_url argument is required" >&2 && exit 1
[ -z "$GITEA_TOKEN" ] && echo "ERROR: gitea_token argument is required" >&2 && exit 1
DISPATCH_URL="$GITEA_API_URL/api/v1/repos/$TARGET_REPO/actions/workflows/$WORKFLOW_FILE/dispatches"
DISPATCH_BODY=$(jq -nc --arg ref "$REF" --argjson inputs "$INPUTS_JSON" '{ref: $ref, inputs: $inputs}')