# How to auto-post to X & LinkedIn when you publish a GitHub release
> Add one GitHub Actions step that schedules an announcement to X & LinkedIn when a release goes live, with a short window to edit or cancel it.
- Published: 2026-10-14
- Last updated: 2026-10-14
- Author: Sanju (Founder & CEO @ DunSocial)
- Topics: cli, how-to
---
Add one step to a GitHub Actions workflow that runs on `release: published` & calls the DunSocial CLI to schedule an announcement. The post lands in your workspace a few minutes ahead of its send time, so you can still edit or cancel it before it goes out.
You need three things: a personal access token, your workspace id, & the account ids for the networks you want to post to.
## Why a release is the right trigger
A release is the moment you have something to say, a version number, & a link. Writing the announcement by hand means opening a composer after every tag, which is the step that gets skipped.
Most guides for this wire each network's OAuth into a workflow tool. With DunSocial the accounts are already connected, so the workflow only needs a token & a command.
## Set up the secrets
1. In the app, open Settings → CLI & create a personal access token.
2. Find your workspace id with `dun workspace list`.
3. List your connected accounts with `dun accounts list --json` & copy the **account ids** for X & LinkedIn. Use ids, not @handles.
4. In your repository, open Settings → Secrets and variables → Actions & add `DUN_TOKEN`, `DUN_WORKSPACE_ID`, `DUN_X_ACCOUNT_ID`, & `DUN_LINKEDIN_ACCOUNT_ID`.
Tokens are bound to one workspace, so a leaked secret cannot reach another one. A token with the default CI scopes is enough for this workflow, so you do not need the delete, draft, memory, or workspace-write scopes.
## The workflow
Replace `VERSION` with the CLI version you tested. Pinning means an upgrade is a choice, not a surprise in your release pipeline.
The tag & URL go through environment variables instead of being pasted into the command. A tag name is user input, so this keeps it from being read as shell.
## What happens next
Ten minutes after the release, the post publishes to both accounts. Until then it sits in DunSocial with a CLI source badge, & you can edit or cancel it in the app.
That delay is the review window. Raise `--in` if your team wants longer to check the wording. DunSocial never publishes anything you did not schedule.
Keep the text short enough for X, which is the tighter of the two. If you change the wording, run `dun posts validate` first to check character limits & platform rules without creating anything.
## Make it more useful
- **Per-network wording.** Add a second step that schedules a longer LinkedIn version to the LinkedIn account only.
- **Other networks.** Add any connected account id to the comma-separated list. Bluesky & Threads take text the same way. Some networks need extra metadata, so check `dun posts --help`.
- **Know when it fails.** A signed webhook tells your own systems when a post publishes or fails. See [DunSocial webhooks](/blog/dunsocial-webhooks-get-notified-when-a-post-publishes-or-fails).
- **Schedule from your terminal instead.** The same command works on a laptop. See [post & schedule from the terminal with the DunSocial CLI](/blog/post-and-schedule-from-the-terminal-with-the-dunsocial-cli).
If you are building a bigger integration, the [API](/blog/schedule-posts-with-the-dunsocial-api) gives you the same scheduling call over HTTP.
## Try it
$20/mo flat, or $192/yr, with a 14-day trial & every feature unlocked from day one. Connect your accounts, add the workflow, & confirm each announcement before it goes out. [Start the trial](https://app.dunsocial.com/login).
## FAQ
### How do I post to X & LinkedIn automatically when I publish a GitHub release?
Add a workflow triggered by `release: published` that runs `dun posts schedule` with your token, workspace id, & account ids. The post is scheduled a few minutes ahead so you can edit or cancel it.
### Can I review the announcement before it goes out?
Yes. The post is scheduled, not published instantly. It appears in your workspace, & you can edit or cancel it in the app until the send time you set with `--in`.
### Do I need to connect X & LinkedIn inside GitHub?
No. You connect them once in DunSocial. The workflow only holds a DunSocial token, never your X or LinkedIn credentials.
### Is it safe to put the token in GitHub secrets?
Store it as a repository secret & never print it in logs. The token is bound to one workspace & can be revoked from Settings → CLI if it leaks.
### Can I run this on a schedule instead of on release?
Yes. GitHub Actions supports cron triggers, & the same `dun posts schedule` command works in any workflow, so you can announce a weekly changelog the same way.
---
## About this document
This is the Markdown representation of https://www.dunsocial.com/blog/auto-post-to-social-media-when-you-publish-a-github-release. The HTML version of the same page is at the same URL. You can also request Markdown from any page by sending `Accept: text/markdown`.
Machine-readable summary of the whole site: https://www.dunsocial.com/llms.txt
## Company
- Product: DunSocial, https://www.dunsocial.com
- Legal entity: THISUX PRIVATE LIMITED, Chennai, Tamil Nadu, India
- Support: support@dunsocial.com
- Open the app: https://app.dunsocial.com/login