.github/actions/status-event/post.sh
Metadata
- Purpose: Reusable GitHub Action used by workflows.
- Domain:
automation - Language:
bash - Bytes: 822
- Lines: 38
- Content hash (short):
415d7e47 - Source (start): .github/actions/status-event/post.sh:1
- Source (end): .github/actions/status-event/post.sh:38
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}",