#!/usr/bin/env bash set -euo pipefail # Fetch the current PR title from the Gitea API. # Requires: API_URL, REPO_OWNER, REPO_NAME, PR_NUMBER, CI_RUNNER_TOKEN : "${API_URL:?API_URL is required}" : "${REPO_OWNER:?REPO_OWNER is required}" : "${REPO_NAME:?REPO_NAME is required}" : "${PR_NUMBER:?PR_NUMBER is required}" : "${CI_RUNNER_TOKEN:?CI_RUNNER_TOKEN is required}" curl -sf \ "${API_URL}/repos/${REPO_OWNER}/${REPO_NAME}/pulls/${PR_NUMBER}" \ -H "Authorization: token ${CI_RUNNER_TOKEN}" \ | python3 -c 'import json, sys; print(json.load(sys.stdin)["title"])'