Skip to content

Early Draft: social media scheduling#17890

Draft
adamgordonbell wants to merge 1 commit intomasterfrom
agb/social-media-scheduling
Draft

Early Draft: social media scheduling#17890
adamgordonbell wants to merge 1 commit intomasterfrom
agb/social-media-scheduling

Conversation

@adamgordonbell
Copy link
Contributor

@adamgordonbell adamgordonbell commented Mar 10, 2026

Automatically schedule social media posts (X/Twitter, LinkedIn, Bluesky) when blog posts with social frontmatter are merged to master.

Idea:
When a blog post with social: frontmatter merges to master, the CI workflow schedules posts to connected platforms via upload-post.com.

Posts are timed based on the Hugo frontmatter date field:

  • Future date: scheduled for that date at 10am ET
  • Today or past: posted immediately
  • More than 2 days old: skipped

If the same post is deployed again, existing scheduled posts are updated rather than duplicated. Already-published
posts are skipped.

Remaining TODO:

  1. Verify idempotency: confirm title field stores URL for matching
  2. Verify history endpoint: confirm post_title matching works
  3. Connect LinkedIn: add account + UPLOAD_POST_LINKEDIN_PAGE_ID to ESC
  4. Connect X/Twitter: add account in upload-post.com
  5. Test each platform: verify posts look right
  6. Bluesky link card image: waiting on upload-post.com feedback

Automatically schedule social media posts (X/Twitter, LinkedIn, Bluesky) when
blog posts with social frontmatter are merged to master.

- CI workflow job runs after site deploy, pulls secrets from Pulumi ESC
- Reads social copy from blog post frontmatter (social.twitter, social.linkedin, social.bluesky)
- Future-dated posts are scheduled; past/today posts are posted immediately
- Idempotency: checks scheduled posts and history to avoid duplicates
- Updates existing scheduled posts via PATCH if copy changes
- X/Twitter: URL appended to text for card unfurling
- LinkedIn/Bluesky: URL sent via link_url for rich preview cards
- Uses uv inline script metadata for dependency management

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link
Contributor

claude bot commented Mar 10, 2026

test

@claude
Copy link
Contributor

claude bot commented Mar 10, 2026

Docs Review

@claude
Copy link
Contributor

claude bot commented Mar 10, 2026

Docs Review - This PR adds automated social media scheduling via upload-post.com. SECTION: .github/workflows/build-and-deploy.yml - (1) actions/checkout@v6 (line 94): verify this version exists; v4 is widely-used. (2) BUILD-AND-DEPLOY.md not updated: new schedule-social job and scripts/social/ directory introduce UPLOAD_POST_API_KEY, UPLOAD_POST_USER, UPLOAD_POST_LINKEDIN_PAGE_ID undocumented. SECTION: scripts/social/schedule-posts.py - (1) Missing request timeouts: add timeout=30 to find_scheduled (line 97), already_published (line 114), schedule_post (line 173). (2) Limited schedule check (line 111): only 50 entries fetched, risk of duplicates. (3) Redundant title for Twitter (lines 155-160): initial data title is overridden by x_title. SECTION: General - PR is Early Draft with 5 open TODOs; gate the job before merging to avoid live social posts. Mention @claude for another pass.

@pulumi-bot
Copy link
Collaborator

@claude
Copy link
Contributor

claude bot commented Mar 10, 2026

Docs Review

This PR adds automated social media scheduling via upload-post.com, triggered after successful site deploys to master. The code is generally well-structured, but there are a few issues to address before this ships.

.github/workflows/build-and-deploy.yml

actions/checkout@v6 (line 94) — Please verify this version exists. The most widely-used release of actions/checkout is v4. If v6 does not exist, the job will fail at runtime. Consider pinning to a confirmed version.

BUILD-AND-DEPLOY.md not updated — Per repository policy, changes to .github/workflows/ and scripts/ require updating BUILD-AND-DEPLOY.md. This PR introduces a new schedule-social job and a new scripts/social/ directory with three new required environment variables (UPLOAD_POST_API_KEY, UPLOAD_POST_USER, UPLOAD_POST_LINKEDIN_PAGE_ID) that are not documented anywhere.

scripts/social/schedule-posts.py

Missing request timeouts — All three requests calls lack a timeout parameter. If the upload-post.com API is unresponsive, the CI job will hang indefinitely and block the workflow. Add timeout=30 to the calls in find_scheduled (around line 97), already_published (around line 114), and schedule_post (around line 173).

Limited schedule check (line 111) — find_scheduled only fetches the last 50 scheduled entries. If the queue grows beyond 50, it could miss an already-scheduled post and create a duplicate. Consider increasing the limit or adding pagination.

Redundant title assignment for Twitter (around lines 155-160) — data title field is set before the per-platform block, then immediately overridden for the Twitter branch via x_title. The initial value is unused in that branch. Minor, but worth cleaning up.

General

This PR is marked "Early Draft" with 5 open TODOs in the description (LinkedIn/X not yet connected, idempotency unverified, platforms untested). The schedule-social job targets the production environment and will attempt to run on every master merge once this lands. Confirm the TODOs are resolved or gate the job with "if: false" before merging to avoid posting to live social platforms before the integration is validated.


Mention @claude if you would like another pass after addressing these items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants