Uh oh!
There was an error while loading. Please reload this page.
feat: publish releases to LinkedIn - #194
Conversation
Adds optional telegram-chat-id/telegram-bot-token to the shared workflow so consumers get a Telegram message on success or failure without wiring a separate notification workflow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed edge cases where truncation helpers can exceed the requested limit and the optional Telegram notify job can run without a provided bot token, leading to avoidable runtime failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a first-party Baseline integration to publish stable GitHub Releases to a maintainer’s LinkedIn member feed via a reusable workflow, keeping the post content deterministic (repository + release metadata) and exposing the resulting LinkedIn post URN.
Changes:
- Introduces reusable workflow(s) to publish release posts to LinkedIn (with optional Telegram notifications) and a local Baseline caller workflow.
- Adds two composite actions: one to format release content into LinkedIn “little” text, and one to resolve the member URN + publish via the LinkedIn REST API.
- Adds README documentation and a focused Python test suite covering formatting, API behavior, and workflow wiring.
File summaries
| File | Description |
|---|---|
test/test_linkedin_release.py | Adds unit tests for message formatting, LinkedIn API request/response handling, and workflow/action wiring. |
README.md | Documents consumer setup for the LinkedIn release publishing workflow, token rotation expectations, and retry guidance. |
.github/workflows/publish-linkedin-release.yml | Adds Baseline’s local caller workflow triggered on release.published. |
.github/workflows/publish-linkedin-release-shared.yml | Adds the reusable workflow implementing LinkedIn publishing + optional Telegram notifications. |
.github/actions/send-linkedin-post/send.py | Implements LinkedIn userinfo lookup and post publishing via urllib. |
.github/actions/send-linkedin-post/action.yml | Composite action wrapper for the LinkedIn sender script. |
.github/actions/prepare-linkedin-release-post/prepare.py | Implements deterministic conversion of release content to LinkedIn little text, including escaping/truncation/hashtags. |
.github/actions/prepare-linkedin-release-post/action.yml | Composite action wrapper for the LinkedIn formatter script. |
Review details
Suppressed comments (1)
.github/actions/prepare-linkedin-release-post/prepare.py:29
truncate_little_text()can also exceedlimitwhenlimit <= 3(it returns...unconditionally), which can violateLINKEDIN_POST_LIMITifdescription_limitis computed as 1–3 chars. Add a small-limit guard before calculatingavailable = limit - 3.
escaped = escape_little_text(value)
if len(escaped) <= limit:
return escaped
available = limit - 3
- Files reviewed: 8/8 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| def truncate(value, limit): | ||
| if len(value) <= limit: | ||
| return value | ||
| return value[: limit - 3].rstrip() + "..." |
| if: >- | ||
| always() && | ||
| inputs.telegram-chat-id != '' && | ||
| (needs.publish.result == 'success' || needs.publish.result == 'failure') |
Summary
Testing
python3 -m unittest discover -s test -v(83 tests)pre-commit run --files README.md .github/actions/prepare-linkedin-release-post/action.yml .github/actions/prepare-linkedin-release-post/prepare.py .github/actions/send-linkedin-post/action.yml .github/actions/send-linkedin-post/send.py .github/workflows/publish-linkedin-release-shared.yml .github/workflows/publish-linkedin-release.yml test/test_linkedin_release.pygit diff --checkNo live LinkedIn post was created during testing.
Closes#193