@gurupanguji

Publish Socials Wrapper Spec

Context

Running Publish Social Snippets currently takes a manual gh workflow run call, an occasional local runner start, and then a separate check to see whether the job finished. The goal is to make that path a single repo-root command without changing the underlying publisher behavior.

This is phase 1. Keep the platform model aligned with scripts/publish_social.py. Do not add CSV parsing or multi-select platform handling. Keep the Pixelfed publish code parked.

Goal

Add a repo-root publish-socials.sh helper that can:

Scope

Non-Goals

User-Facing Interface

Command shape

Defaults

Platform names

Accept one platform name per invocation.

Canonical names:

Alias handling:

Pixelfed stays parked. The wrapper may accept the name, but the publish path remains unchanged and does not unpark that code.

Design

The wrapper should do three things in order:

  1. Resolve arguments and normalize the platform name if one was provided.
  2. Ensure the self-hosted runner is running when --runner self-hosted is selected.
  3. Dispatch the workflow with gh workflow run, then wait for the new run and report the result.

Runner handling should be deliberately simple. The script only needs to know whether the local runner process is already active. If not, it should start ~/dev/gurupanguji.github.io/actions-runner/run.sh, then wait until GitHub reports a matching run. If --runner github-hosted is selected, the wrapper must skip local runner startup entirely.

For workflow status, the wrapper should find the newest matching run for Publish Social Snippets on the requested ref, then watch it until completion. If dispatch succeeds but no run appears, the script should fail loudly and show the dispatch parameters it used. After the run finishes, the wrapper should stop the local runner when it started one for this invocation. That shutdown should happen whether the workflow succeeds, fails, or exits in any other terminal state.

Workflow Contract

The workflow must support two execution modes:

The wrapper should pass the runner choice through to workflow_dispatch, and the workflow should choose the appropriate runs-on value from that input.

The workflow already accepts date and platform, so the wrapper should reuse those fields instead of inventing a second dispatch path.

Error Handling

Acceptance Criteria

  1. ./publish-socials.sh works from the repo root.
  2. --date defaults to today when omitted.
  3. --ref defaults to main when omitted.
  4. --runner self-hosted starts the local runner only if needed.
  5. --runner github-hosted skips local runner startup.
  6. --platform accepts exactly one social name and maps simple aliases.
  7. The workflow run is watched to completion and its final status is printed.
  8. The wrapper stops any local runner it started after the workflow completes.
  9. Pixelfed remains parked.

File Changes