Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -640,5 +640,8 @@ jobs:
CHANNEL: live
# HMAC auth (reused from the emit job's secret).
ROADMAP_CI_EVENT_HMAC_KEY: ${{ secrets.ROADMAP_CI_EVENT_HMAC_KEY }}
ROADMAP_PUBLISH_URL: ${{ secrets.ROADMAP_PUBLISH_URL }}
# API base URL — the publish endpoint path is appended by the
# script. Reuses the existing STARSTATS_API_URL secret rather
# than a separate per-endpoint URL secret.
STARSTATS_API_URL: ${{ secrets.STARSTATS_API_URL }}
run: node scripts/auto-publish-changelog.mjs
20 changes: 13 additions & 7 deletions scripts/auto-publish-changelog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
// Required env vars:
// - ROADMAP_CI_EVENT_HMAC_KEY Shared secret (raw bytes / UTF-8).
// Same key as the emit endpoint.
// - ROADMAP_PUBLISH_URL Full URL of the publish endpoint, e.g.
// `https://api.starstats.app/v1/internal/roadmap/changelog/publish`.
// Separated from `ROADMAP_EVENTS_URL` so
// each endpoint can rotate independently.
// - STARSTATS_API_URL Base URL of starstats-server, e.g.
// `https://api.starstats.app`. The publish
// endpoint path (`/v1/internal/roadmap/
// changelog/publish`) is appended
// automatically. Shared with the existing
// admin-CLI publish path; one secret, one
// source of truth for the API hostname.
// - ROADMAP_ITEM_SLUG Slug to publish drafts for. Required.
//
// Optional:
Expand Down Expand Up @@ -55,8 +58,8 @@ const env = process.env;
if (!env.ROADMAP_CI_EVENT_HMAC_KEY) {
noop('ROADMAP_CI_EVENT_HMAC_KEY not set (pipeline not configured)');
}
if (!env.ROADMAP_PUBLISH_URL) {
noop('ROADMAP_PUBLISH_URL not set (pipeline not configured)');
if (!env.STARSTATS_API_URL) {
noop('STARSTATS_API_URL not set (pipeline not configured)');
}
if (!env.ROADMAP_ITEM_SLUG) {
noop('ROADMAP_ITEM_SLUG not set (no item to publish for)');
Expand Down Expand Up @@ -88,7 +91,10 @@ mac.update(`v1.${ts_ms}.`);
mac.update(body);
const sig = `v1=${mac.digest('hex')}`;

const url = env.ROADMAP_PUBLISH_URL;
// Compose the endpoint URL from the base. Trim trailing slashes so
// `STARSTATS_API_URL=https://api.starstats.app/` and the bare form
// both resolve identically.
const url = `${env.STARSTATS_API_URL.replace(/\/+$/, "")}/v1/internal/roadmap/changelog/publish`;
const headers = {
'content-type': 'application/json',
'X-StarStats-Timestamp': ts_ms,
Expand Down
Loading