From fa57a152e435128eb83da025257ce9a4314eb99c Mon Sep 17 00:00:00 2001 From: moilanik Date: Mon, 22 Jun 2026 06:03:51 +0300 Subject: [PATCH] self commit status about gitops --- scripts/dispatch-workflow.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/dispatch-workflow.sh b/scripts/dispatch-workflow.sh index 280a62d..a0d7a56 100755 --- a/scripts/dispatch-workflow.sh +++ b/scripts/dispatch-workflow.sh @@ -77,6 +77,12 @@ while true; do if [ "$STATUS" = "completed" ]; then CONCLUSION=$(echo "$RUN_RESP" | jq -r '.conclusion // "failure"') if [ "$CONCLUSION" = "success" ]; then + GITOPS_COMMIT="" + BRANCH_RESP=$(curl -s --connect-timeout 5 --max-time 10 \ + "$GITEA_API_URL/api/v1/repos/$TARGET_REPO/branches/$REF" \ + -H "Authorization: token $GITEA_TOKEN") || true + GITOPS_COMMIT=$(echo "$BRANCH_RESP" | jq -r '.commit.id // empty') + echo "GITOPS_COMMIT=$GITOPS_COMMIT" exit 0 fi echo "ERROR: Workflow completed with conclusion: $CONCLUSION" >&2