Coder Social home page Coder Social logo

share-post-action's Introduction

Share Post GitHub Action

This GitHub Action is designed to automatically announce new blog posts on Twitter and Mastodon for Hugo or other static site generator content repositories. When a new blog post is added to your repository, this action will generate an announcement text and share it on the specified social media platforms.

Note: This project was completely generated using OpenAI's GPT-4.

Features

  • Automatically generate announcement text based on a template.
  • Share new blog posts on Twitter or Mastodon.

Requirements

  • A Hugo or similar static site generator content repository.
  • Twitter API keys and access tokens (optional).
  • Mastodon instance URL and access token (optional).

Usage

  1. Create a new file called .github/workflows/share-post.yml in your content repository.
  2. Add the following content to the share-post.yml file:
on:
  push:
    branches:
      - main

jobs:
  share_post:
    runs-on: ubuntu-latest
    steps:
      - uses: punchagan/share-post-action@v1
        with:
          base_url: <YOUR_WEBSITE_BASE_URL>
        env:
          TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
          TWITTER_API_SECRET_KEY: ${{ secrets.TWITTER_API_SECRET_KEY }}
          TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
          TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
          MASTODON_INSTANCE: ${{ secrets.MASTODON_INSTANCE }}
          MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
  1. Replace <YOUR_WEBSITE_BASE_URL> with the base URL of your website.
  2. Add your Twitter and Mastodon API keys and access tokens to your repository's secrets. You can find more information on how to do this here.

Configuration

Inputs

Name Description Required Default
base_url The base URL of your website Yes
announcement_template The template for the announcement text. Use {{TITLE}}, {{POST_URL}}, {{TAGS}}, and {{DESCRIPTION}} as placeholders. No New blog post: {{TITLE}} - {{POST_URL}} {{TAGS}}
post_subdirectory The subdirectory inside the content folder that contains the blog posts No posts

share-post-action's People

Contributors

punchagan avatar

Stargazers

 avatar

Watchers

 avatar Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.