Skip to main content

.github/actions/status-event/post.sh

Metadata

Indexed Symbols

No indexed functions/methods detected in this file.

Markdown Headings (if applicable)

No markdown headings detected.

Source Preview

#!/usr/bin/env bash
set -euo pipefail

PROJECT_ID=$1
ENVIRONMENT=$2
VERSION=$3
EVENT_TYPE=$4
STATUS_URL=$5
METADATA_JSON=${6:-}

if [ -z "${STATUS_API_URL:-}" ] || [ -z "${STATUS_API_TOKEN:-}" ]; then
echo "STATUS_API_URL or STATUS_API_TOKEN not set"
exit 1
fi

METADATA_BLOCK=""
if [ -n "${METADATA_JSON}" ]; then
METADATA_BLOCK=", \"metadata\": ${METADATA_JSON}"
fi

PAYLOAD=$(cat <<JSON
{
"project_id": "${PROJECT_ID}",
"environment": "${ENVIRONMENT}",
"version": "${VERSION}",