name: Auto Post to Facebook Group on: release: types: [published] # Triggers when a new release is published jobs: post-to-facebook: runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 - name: Send Post via Facebook Graph API run: | TEXT_CONTENT="📢 New Project Update! Run code version $ github.event.release.tag_name is live. Read the release notes here: $ github.event.release.html_url " curl -X POST "https://facebook.com secrets.FB_GROUP_ID /feed" \ -d "message=$TEXT_CONTENT" \ -d "access_token=$ secrets.FB_ACCESS_TOKEN " Use code with caution. How This Script Works
Create another secret named FB_GROUP_ID and paste your group ID. Step 2: Create the GitHub Actions Workflow
Convert this token to a long-lived token (lasting 60 days) or a permanent token by making an API call to the OAuth endpoint: auto post group facebook github
Where do you plan to ? (GitHub Actions, a local PC, or a VPS) Share public link
Triggers every time code is pushed to a specific branch (e.g., main ). name: Auto Post to Facebook Group on: release:
Facebook actively detects automated activity. Excessive posting can lead to account suspension or restricted functionality.
They leverage visual workflow engines to trigger a Facebook post whenever a specific event occurs, such as a new GitHub issue or a repository star. Step-by-Step Guide: Setting Up a Python Auto-Poster How This Script Works Create another secret named
: Some tools allow text variations (e.g., Hi) to ensure every post is slightly different, reducing spam detection. Non-Technical Alternatives
Map the data from GitHub into your Facebook post template. For example: