Coder Social home page Coder Social logo

github-readme-blog-post-action's Introduction

Github Readme Blog Post Action

A (somewhat) simple github action that generates a set of cards for recent blog posts.

Here's an example of how it looks given the URLs for DEV Community, JavaScript Weekly, and Echo JS:

DEV Community

The most recent home feed on DEV Community.

Read more

Last updated: Wednesday, August 23, 2023 at 6:36:28 PM

Showing 5 of 12 posts.

Introduction to the Tower library Setting up Bcrypt in your Rails project Interesting Malware Analysis Writeups Agile or not Agile How to mirror GitLab repo to GitHub

JavaScript Weekly

A newsletter of JavaScript articles, news and cool projects

Read more

Last updated: Wednesday, August 23, 2023 at 6:36:32 PM

Showing 4 of 4 posts.

We're taking a few weeks off, but.. Svelte 5 is going to be radical Taking JavaScript into Python Name mangling

Echo JS

Description pending

Read more

Last updated: Wednesday, August 23, 2023 at 6:36:38 PM

Showing 5 of 30 posts.

Error Handling in React: Techniques and Examples GitHub - oslabs-beta/Chronos: ๐Ÿ“Š ๐Ÿ“Š ๐Ÿ“Š Monitors the health and web traffic of servers, microservices, Kubernetes/Kafka clusters, containers, and AWS services with real-time data monitoring and receive automated notifications over Slack or email. GitHub - codeacme17/examor: For students, scholars, interviewees and lifelong learners React JS Clean Code Guide API with NestJS #121. Many-to-one relationships with PostgreSQL and Kysely

Quick Start

This action runs out-of-the-box, with only one provided input.

Create a .yml file with the desired filename, and paste the following:

on:
  push:
  schedule:
    - cron: "0 */6 * * *"
jobs:
  blog:
    runs-on: ubuntu-latest
    name: Fetch and Generate Blog Posts
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Generate
        uses: ErrorGamer2000/github-readme-blog-post-action@v1
        with:
          feed_urls: FEEDS
      - name: Commit changed files
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Save Generated Blog Posts
          skip_checkout: true

Replace the FEEDS with a comma-seperated list of RSS feed URLs, add

<!-- blog-post-list:start -->
<!-- blog-post-list:end -->

in the README where you want the list, and BAM! You have yourself an automatic action that runs every 6 hours and when you change any of the files in your readme!

Inputs

Option Name Type Default Value Description
feed_urls string "" A (comma-seperated) list of RSS feed URLs to load posts from. This is the only required input.
max_posts_per_url number 5 The maximum number of posts to show for each feed. If the number of posts is less than this, then all of the posts will be shown.
position_indicator string blog-post-list The text of the comments that the action uses to inject the images into the README file. Everything between the two comments in the form <!-- position_indicator:start --> and <!-- position_indicator:end --> is replaced. Changing this can allow you to use multiple configurations for different feeds by using different markers for each.
show_feed_data boolean true Whether or not to show the generated markdown describing the feed, which includes the title of the feed, the description of the feed, the Read More link, the last updated date, and the post count. Each of these can also be individually toggled with the following options. This will override any of the specific options, so it is better to disable/enable them specifically if you want to remove some elements.
show_feed_title boolean true Whether or not to show the header containing the title of the feed. This will be formatted as an h2 header. An option to customize this header will be in a future update.
show_feed_description boolean true Whether or not to show the title of the feed that is provided by the RSS feed.
show_read_more boolean true Whether or not to show the Read More link under the feed description.
show_last_updated_date boolean true Whether or not to show the date and time of the last update of the list.
show_post_count boolean true Whether or not to show the number of posts shown and the total number of posts provided by the RSS feed.
show_post_date boolean true Whether or not to show the date of each post on the card.
locale string "en" The locale of the project. This is used purely for formatting the dates of the cards and last update.
time_zone string "UTC" A valid time zone to use for the last updated date.
output_dir string "blog-post-list-output" The directory to store the post card images in. Must be in the root directory (i.e. no path separators / or \) and cannot include the characters /\?%*:|"<>.

Usage Notes

  • Make sure that you use an action that will commit changed files to the repository after this action has run, so that the files actually get changed.
  • I am a solo dev, and will get back to you as soon as I can, so expect to wait several weeks depending on how many other issues there are.
  • Enjoy and share! ๐Ÿค—

github-readme-blog-post-action's People

Contributors

nexensys avatar redguy12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

github-readme-blog-post-action's Issues

[Missing Image]: Test 2

What is the title of the post that the image was supposed to be for?

Ttile Here

What browsers are you seeing the problem on?

No response

Workflow configuration yml file

name: Update example images
on:
  push:
  schedule:
    - cron: "0 */6 * * *"
jobs:
  run:
    runs-on: ubuntu-latest
    name: Update the example on the README
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Generate
        uses: ./
        with:
          feed_urls: "https://dev.to/feed,https://cprss.s3.amazonaws.com/javascriptweekly.com.xml,https://www.echojs.com/rss"
          max_posts_per_url: 5
          position_indicator: "post-list"
          locale: "en-US"
          time_zone: "America/Denver"
          output_dir: "generated_files"
      - name: Commit changed files
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Save generated content
          skip_checkout: true

Action errors and warnings

No response

[Markdown Error]: Link broken. Not linking to local image file in repository

Link to broken markdown

https://raw.githubusercontent.com/https://master/blog-post-list-output/Git_Griefed/Blast_From_The_Past.svg

Workflow configuration yml file

- name: Generate
  uses: ErrorGamer2000/github-readme-blog-post-action@v1
  with:
    feed_urls: "https://blog.griefed.de/feed"

Other information

Instead of linking to raw GitHub content for the svg-files, the links should reference the local file in the repository, like blog-post-list-output/Git_Griefed/Nlast_From_The_Past.svg.

Or allow users to set a true|false-flag for whether the link should be a relative path (file in repo blog-post-list-output/...), or a URL (raw.githubusercontent.com/...)

[![Blast From The Past](https://raw.githubusercontent.com/https://master/blog-post-list-output/Git_Griefed/Blast_From_The_Past.svg)](https://blog.griefed.de/2022/06/17/blast-from-the-past/)
[![Qodana, GitLab and Discord](https://raw.githubusercontent.com/https://master/blog-post-list-output/Git_Griefed/Qodana__GitLab_and_Discord.svg)](https://blog.griefed.de/2022/04/30/qodana-and-gitlab/)
[![Let Them Trade by Spaceflower โ€“ and a mapeditor!](https://raw.githubusercontent.com/https://master/blog-post-list-output/Git_Griefed/Let_Them_Trade_by_Spaceflower_โ€“_and_a_mapeditor!.svg)](https://blog.griefed.de/2021/10/05/let-them-trade-by-spaceflower-and-a-mapeditor/)
[![Detecting the sideness of mods with ServerPackCreator](https://raw.githubusercontent.com/https://master/blog-post-list-output/Git_Griefed/Detecting_the_sideness_of_mods_with_ServerPackCreator.svg)](https://blog.griefed.de/2021/08/11/detecting-the-sideness-of-mods-with-serverpackcreator/)
[![Addons for ServerPackCreator!](https://raw.githubusercontent.com/https://master/blog-post-list-output/Git_Griefed/Addons_for_ServerPackCreator!.svg)](https://blog.griefed.de/2021/08/02/addons-for-serverpackcreator/)

I absolutely love the style with which the blog posts are embedded in the examples in this action. Thanks for all the hard work!

Cheers,
Griefed

[Missing Image]: Test new issue form

What is the title of the post that the image was supposed to be for?

Post Title Here

What browsers are you seeing the problem on?

Chrome, Microsoft Edge

Workflow configuration yml file

on:
  push:
  schedule:
    - cron: "0 */6 * * *"
jobs:
  run:
    runs-on: ubuntu-latest
    name: Update the example on the README
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Generate
        uses: ./
        with:
          feed_urls: "https://dev.to/feed,https://cprss.s3.amazonaws.com/javascriptweekly.com.xml,https://www.echojs.com/rss"
          max_posts_per_url: 5
          position_indicator: "post-list"
          locale: "en-US"
          time_zone: "America/Denver"
          output_dir: "generated_files"
      - name: Commit changed files
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Save generated content
          skip_checkout: true

Action errors and warnings

None

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.