A github workflow to do a linkedin post everytime you update your blog RSS Feed
git clone https://github.com/p4p1/linkedin-marketing-workflow.gitThe LinkedIn Marketing Workflow skill is a powerful GitHub automation tool designed to streamline your social media presence by automatically posting updates to LinkedIn whenever you update your blog's RSS feed. This skill simplifies the process of keeping your LinkedIn profile active and engaging, ensuring that your audience is consistently informed about your latest content without requiring manual intervention. By integrating this workflow into your existing systems, you can enhance your marketing strategy with minimal effort. One of the key benefits of this skill is the time savings it offers. While the exact time savings may not be quantified, the reduction in manual posting efforts can free up valuable time for marketers and developers alike. Instead of spending time crafting and scheduling posts, you can focus on creating high-quality content and engaging with your audience. This automation not only increases efficiency but also ensures that your LinkedIn presence remains dynamic and up-to-date with your latest blog entries. This skill is particularly beneficial for marketers, product managers, and AI practitioners who are looking to enhance their workflow automation capabilities. By leveraging this Claude Code skill, users can ensure that their LinkedIn profiles are automatically updated, allowing them to maintain a strong online presence without the repetitive task of posting manually. For example, a product manager can use this skill to share product updates and insights directly from their blog, while a marketer can promote new articles and thought leadership pieces effortlessly. Implementing the LinkedIn Marketing Workflow is straightforward, requiring an intermediate level of technical knowledge and approximately 30 minutes to set up. Users will need a GitHub account and familiarity with GitHub workflows to get started. This skill fits seamlessly into AI-first workflows by automating routine tasks, allowing users to focus on strategic initiatives. By integrating this automation into your marketing efforts, you can enhance your overall productivity and ensure that your online presence remains consistent and impactful.
[{"step":"Set up your LinkedIn Developer App","action":"Go to the LinkedIn Developer Portal (https://www.linkedin.com/developers/), create a new app, and request the `w_member_social` permission. Generate an access token with 60-day expiration. Store this token as a GitHub secret named `LINKEDIN_ACCESS_TOKEN` in your repository settings.","tips":["Use a dedicated LinkedIn account for automation to avoid personal account restrictions.","Set a calendar reminder to refresh the token before it expires.","Test the token manually using curl or Postman before integrating it into the workflow."]},{"step":"Customize the workflow for your blog","action":"Edit the `.github/workflows/linkedin-blog-post.yml` file to replace `https://yourblog.com/feed.xml` with your blog's RSS feed URL. Adjust the polling interval (e.g., `cron: '0 */6 * * *'` for every 6 hours) based on how frequently you publish new posts.","tips":["Use a reliable RSS feed generator if your blog doesn't natively support RSS (e.g., Feedity or RSS.app).","Test the RSS feed URL in a browser or RSS reader to confirm it's accessible and contains valid post data.","For static site generators like Hugo or Jekyll, ensure the RSS feed is generated during the build process."]},{"step":"Configure the LinkedIn post template","action":"Modify the `format_post` step in the workflow to customize the LinkedIn post format. For example, change the hashtags, add emojis, or include a call-to-action like 'Read the full post and let me know your thoughts!'","tips":["Keep LinkedIn posts under 1,300 characters for optimal engagement.","Include relevant hashtags (3-5) to increase discoverability.","Add a question at the end to encourage comments and discussion."]},{"step":"Test the workflow","action":"Manually trigger the workflow via the GitHub Actions tab to test the automation. Publish a test blog post and verify it appears on your LinkedIn profile. Check the workflow logs for errors or failed API calls.","tips":["Start with a short polling interval (e.g., every 30 minutes) during testing to speed up iterations.","Use the `workflow_dispatch` trigger to test without waiting for the scheduled run.","Monitor the LinkedIn profile to ensure posts are published correctly and appear as expected."]},{"step":"Monitor and maintain the workflow","action":"Regularly check the workflow runs for errors or failures. Update the LinkedIn access token before it expires, and adjust the RSS feed URL or post template as needed. Consider adding error notifications (e.g., Slack alerts) for critical failures.","tips":["Set up a Slack or email notification for workflow failures using GitHub Actions secrets.","Use the GitHub Actions cache to store the last posted article ID for faster comparisons.","Review LinkedIn analytics to track engagement and adjust your posting strategy accordingly."]}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/p4p1/linkedin-marketing-workflowCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Create a GitHub Actions workflow that automates LinkedIn posts whenever a new blog post is published in [BLOG_RSS_FEED_URL]. The workflow should: 1) Poll the RSS feed every [POLLING_INTERVAL, e.g., 6 hours], 2) Extract the title and URL of new posts, 3) Format a professional LinkedIn post using [POST_TEMPLATE, e.g., 'Check out my latest blog post: [TITLE] [URL] #ContentMarketing'], 4) Post to LinkedIn via the [LINKEDIN_API_METHOD, e.g., official API or third-party service like Buffer]. Include error handling for API failures and logging for debugging.
## GitHub Actions Workflow: LinkedIn Blog Post Automation
**Workflow File:** `.github/workflows/linkedin-blog-post.yml`
```yaml
name: LinkedIn Blog Post Automation
on:
schedule:
- cron: '0 */6 * * *' # Runs every 6 hours
workflow_dispatch: # Allows manual triggering
jobs:
check-blog-and-post:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fetch and parse RSS feed
id: rss_parser
uses: thegamenicorus/rss-parser@v1
with:
url: https://yourblog.com/feed.xml
- name: Check for new posts
id: check_new
run: |
echo "Checking for new posts..."
LAST_POST=$(cat .last_post_id.txt 2>/dev/null || echo "")
NEW_POSTS=$(echo "${{ steps.rss_parser.outputs.items }}" | jq -r '.[] | select(.id != "'"$LAST_POST"'")')
if [ -z "$NEW_POSTS" ]; then
echo "No new posts found."
echo "new_posts=false" >> $GITHUB_OUTPUT
else
echo "new_posts=true" >> $GITHUB_OUTPUT
echo "$NEW_POSTS" > .new_posts.json
fi
- name: Format LinkedIn post
if: steps.check_new.outputs.new_posts == 'true'
id: format_post
run: |
POST_TITLE=$(jq -r '.[0].title' .new_posts.json)
POST_URL=$(jq -r '.[0].link' .new_posts.json)
POST_TEXT="Check out my latest blog post: $POST_TITLE
$POST_URL
#ContentMarketing #Blogging"
echo "post_text=$POST_TEXT" >> $GITHUB_OUTPUT
echo "$POST_URL" > .last_post_id.txt
- name: Post to LinkedIn
if: steps.check_new.outputs.new_posts == 'true'
uses: actions/github-script@v6
with:
script: |
const postText = `${{ steps.format_post.outputs.post_text }}`;
const linkedInApiUrl = 'https://api.linkedin.com/v2/ugcPosts';
const accessToken = process.env.LINKEDIN_ACCESS_TOKEN;
const response = await fetch(linkedInApiUrl, {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'X-Restli-Protocol-Version': '2.0.0'
},
body: JSON.stringify({
author: 'urn:li:person:YOUR_LINKEDIN_ID',
lifecycleState: 'PUBLISHED',
specificContent: {
com.linkedin.ugc.ShareContent: {
shareCommentary: {
text: postText
},
shareMediaCategory: 'NONE'
}
},
visibility: {
com.linkedin.ugc.MemberNetworkVisibility: 'PUBLIC'
}
})
});
if (!response.ok) {
core.setFailed(`LinkedIn API error: ${response.statusText}`);
}
env:
LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }}
```
**Setup Instructions:**
1. Replace `https://yourblog.com/feed.xml` with your blog's RSS feed URL.
2. Replace `YOUR_LINKEDIN_ID` with your LinkedIn personal profile ID (found in your LinkedIn profile URL).
3. Create a LinkedIn app at [LinkedIn Developer Portal](https://www.linkedin.com/developers/) and obtain an access token with `w_member_social` permissions.
4. Add the access token as a GitHub secret named `LINKEDIN_ACCESS_TOKEN`.
5. Customize the post template in the `format_post` step to match your preferred LinkedIn post style.
**Testing:**
- Manually trigger the workflow via GitHub Actions tab to test.
- Check the LinkedIn profile to verify the post appears correctly.
- Monitor the workflow logs for errors or failed API calls.
**Troubleshooting:**
- If posts aren't appearing, verify the RSS feed is accessible and contains valid data.
- Check the LinkedIn API token hasn't expired (tokens typically expire after 60 days).
- Ensure the LinkedIn app has the correct permissions and hasn't been restricted by LinkedIn.Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan