GithubHelp home page GithubHelp logo

gautamkrishnar / blog-post-workflow Goto Github PK

View Code? Open in Web Editor NEW
2.9K 20.0 254.0 1.41 MB

Show your latest blog posts from any sources or StackOverflow activity or Youtube Videos on your GitHub profile/project readme automatically using the RSS feed

Home Page: https://github.com/marketplace/actions/blog-post-workflow

License: GNU Affero General Public License v3.0

JavaScript 100.00%
rss rss-feed github-actions github-workflow blog blogging blog-posts stackoveflow activity profile-readme

blog-post-workflow's Introduction

Blog post workflow Build and test

preview

How to use

  1. Star this repo 😉

  2. Go to your repository

  3. Add the following section to your README.md file, you can give whatever title you want. Just make sure that you use <!-- BLOG-POST-LIST:START --><!-- BLOG-POST-LIST:END --> in your readme. The workflow will replace this comment with the actual blog post list:

    # Blog posts
    <!-- BLOG-POST-LIST:START -->
    <!-- BLOG-POST-LIST:END -->
  4. Create a folder named .github and create a workflows folder inside it, if it doesn't exist.

  5. Create a new file named blog-post-workflow.yml with the following contents inside the workflows folder:

    name: Latest blog post workflow
    on:
      schedule: # Run workflow automatically
        - cron: '0 * * * *' # Runs every hour, on the hour
      workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the GitHub Actions Workflow page directly
    permissions:
      contents: write # To write the generated contents to the readme
    
    jobs:
      update-readme-with-blog:
        name: Update this repo's README with latest blog posts
        runs-on: ubuntu-latest
        steps:
          - name: Checkout
            uses: actions/checkout@v4
          - name: Pull in dev.to posts
            uses: gautamkrishnar/blog-post-workflow@v1
            with:
              feed_list: "https://dev.to/feed/gautamkrishnar,https://www.gautamkrishnar.com/feed/"
  6. Replace the above URL list with your own RSS feed URLs. See popular-sources for a list of common RSS feed urls. Commit the changes.

  7. Go to repository settings, Click on Actions > General. Update the "Workflow permissions" to "Read and write permissions". Click on save.

    Workflow permissions

  8. Wait for it to run automatically, or you can also trigger it manually to see the result instantly. To trigger the workflow manually, please follow the steps in the video.

Options

This workflow has additional options that you can use to customize it for your use case. The following are the list of options available:

Option Default Value Description Required
feed_list "" Comma-separated list of RSS feed urls, eg: https://example1.com,https://example2.com Yes
max_post_count 5 Maximum number of posts you want to show on your readme, all feeds combined No
readme_path ./README.md Comma separated paths of the readme files you want to update No
gh_token your GitHub token with repo scope Use this to configure the token of the user that commits the workflow result to GitHub No
comment_tag_name BLOG-POST-LIST Allows you to override the default comment tag name (<!-- BLOG-POST-LIST:START --><!-- BLOG-POST-LIST:END -->), if you want to show multiple instances of the action on the same repo, see advanced usage for more info No
disable_sort false Disables the sorting of the list based on publish date No
feed_names "" Comma-separated list of RSS feed names, this is intended to be used with template option. eg: Blog,Dev.to No
template default Allows you to change the structure of the posts list by using different variables. By default this workflow uses markdown list format to render the posts, you can override this behavior using this option. Eg: [$title]($url) will give you a space-separated list of posts.

Supported variables
  • $title: Title of the post
  • $url: URL of the post
  • $description: Description of the post
  • $newline: Inserts a newline
  • $date: Inserts the post date based on the date_format specified
  • $randomEmoji: Allow you to use random emojis in the post, pass emojis as the parameter to chose one of it randomly in each post item. Eg: $randomEmoji(💯,🔥,💫,🚀,🌮). See the issue comment for more details
  • $emojiKey: You can use this argument to show emojis on each of your post item sequentially in the order you specify. Example: $emojiKey(💯,🔥,💫). See the issue comment for more details
  • $counter: You can use this argument to show a serial number on each of your post items.
  • $feedName: You can use this argument to show a string that represents your website name, use feed_names argument to specify it for each feed item. Eg: feed_list: "https://dev.to/feed/gautamkrishnar,https://www.gautamkrishnar.com/feed/", feed_names: "Dev.to,Personal Website"
  • $categories: You can use this to show a comma separated list of post categories if available. See this issue for more details
No
categories_template default By default $categories variable in the template is a comma separated string of categories. This option will allow you override it and customize the category item according to your use case. Following are the variables available:
  • $category: Represents individual category item
eg: <code>$category</code> will show category list as category1 category2 category3 etc
No
date_format UTC:ddd mmm dd yyyy h:MM TT Allows you to change the format of the date or time displayed when using the $date in the template option. This uses NPM dateformat library, please read the library documentation for the supported formats No
user_agent rss-parser Allows you to customize the user agent used by the RSS feed crawler No
accept_header application/rss+xml Allows you to customize the accept header of the http requests No
tag_post_pre_newline true if you are not using template option Allows you to insert a newline before the closing tag and after the opening tag when using the template option if needed, for better formatting No
filter_comments stackoverflow/Comment by $author/,stackexchange/Comment by $author/ Comma separated list of platforms you want to enable the comment filter.

Available filters
  • stackoverflow/Comment by $author/: Allows you to filter out the StackOverflow comments. Argument to this filter is optional, it defaults to 'Comment by $author'. If you use any language other than English on StackOverflow, you can use this argument to customize it. See #16 for more info.
  • stackexchange/Comment by $author/: Allows you to filter out the StackExchange comments. Argument to this filter follows the same format as stackoverflow filter's argument.
No
custom_tags "" Allows you to use the custom tags from your feed items in your template. Format: variableName/tagName/,variableName/tagName/. Please see the issue comment for more details No
title_max_length "" Allows you to trim the title in the posts list, excess text will be appended with an ellipsis ... No
description_max_length "" Allows you to trim the description in the posts list, excess text will be appended with an ellipsis ... No
item_exec "" Allows you to execute custom JavaScript code on each post item fetched from the xml to do advanced text manipulation. Please see the issue comment as an example No
commit_message Updated with the latest blog posts Allows you to customize the commit message No
committer_username blog-post-bot Allows you to customize the committer username No
committer_email [email protected] Allows you to customize the committer email No
output_only false Sets the generated array as results output variable so that it can be consumed in other actions and parsed via utilities like jq. This will also prevent committing to readme. See #51 for more details about the output format and how to use it. This will also generate a JSON file named /tmp/blog_post_workflow_output.json that you can use to consume the generated data and avoid issues like #110. No
enable_keepalive true Workflow will automatically do a dummy commit to keep the repository active if there is no commit activity for the last 50 days. GitHub will stop running all cron based triggers if the repository is not active for more than 60 days. This flag allows you to disable this feature. See #53 for more details. No
retry_count 0 Maximum number of times to retry the fetch operation if it fails, See #66 for more details. No
retry_wait_time 1 Time to wait before each retry operation in seconds. No
disable_html_encoding false Disables html encoding of the feed contents. No
disable_item_validation false Disables the validation checks for Title, publish date and URL. No
filter_dates "" Allows you to filter post items based on date range.

Supported Values
  • daysAgo/N/: Use this value to display only the posts from the last N days. eg: daysAgo/10/ will show only posts from last 10 days.
  • currentMonth: Use this value to display the post that are published on current month.
  • currentYear: Use this value to display the post that are published on current year.
Make sure that you set the max_post_count to a higher value to get rid of max post count filtering, before using the above options.
No
rand_seed "username/repository" Provide your own seeding string for the randomness. More info: #152 No
remove_duplicates false Allows you to remove duplicate blog posts from multiple sources, if are cross posting. This filters contents based on blog post's title. No
skip_commit false Allows you to prevent the workflow from creating a new commit in the repository. Nevertheless of this option, changes to the readme will be made. This is particularly useful if you want to do the commits manually using the git cli or another workflow. One of the important thing to note is that the workflow will still do the keepalive commits, if you want to disable it you can use the enable_keepalive option instead. No

Advanced usage examples

Click to expand:

StackOverflow example

The following configuration allows you to show your latest StackOverflow activity along with your latest blog posts in the GitHub profile or project readme:

  1. Follow the steps mentioned in the how to use section.
  2. Add the following section to your README.md file, you can give whatever title you want. Just make sure that you use <!-- STACKOVERFLOW:START --><!-- STACKOVERFLOW:END --> in your readme. The workflow will replace this comment with the actual StackOverflow activity:
    # StackOverflow Activity
    <!-- STACKOVERFLOW:START -->
    <!-- STACKOVERFLOW:END -->
  3. Create stack-overflow-workflow.yml in your workflows folder with the following contents, replace 4214976 with your StackOverflow user ID:
    name: Latest stack overflow activity
    on:
      schedule:
        # Runs every 5 minutes
        - cron: '*/5 * * * *'
      workflow_dispatch:
    permissions:
      contents: write
      
    jobs:
      update-readme-with-stack-overflow:
        name: Update this repo's README with latest activity from StackOverflow
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: gautamkrishnar/blog-post-workflow@v1
            with:
              comment_tag_name: "STACKOVERFLOW"
              commit_message: "Updated readme with the latest stackOverflow data"
              feed_list: "https://stackoverflow.com/feeds/user/4214976"
See the result!

advanced

Blog post table
workflow.yml
name: Latest stack oveflow activity
on:
  workflow_dispatch:
  schedule:
    - cron:  '0 * * * *'
permissions:
      contents: write
jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest activity from StackOverflow
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: gautamkrishnar/blog-post-workflow@v1
        with:
          comment_tag_name: "STACKOVERFLOW"
          feed_list: "https://stackoverflow.com/feeds/user/4214976"
          template: "<tr><td>$title</td><td>$url</td></tr>"
Readme.md
### Latest StackOveflow activity of [@gautamkrishnar](https://github.com/gautamkrishnar)
<table>
  <tr><th>Title</th><th>Link</th></tr>
  <!-- STACKOVERFLOW:START --><!-- STACKOVERFLOW:END -->
</table>

Preview: https://github.com/gkr-bot/gkr-bot#latest-stackoveflow-activity-of-gautamkrishnar

Results

image

Youtube videos table
workflow.yml
name: Latest YouTube Videos
on:
  schedule:
    # Runs every hour, on the hour
    - cron: "0 * * * *"
  workflow_dispatch:
permissions:
      contents: write

jobs:
  update-readme-with-youtube:
    name: Update this repo's README with latest videos from YouTube
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://www.youtube.com/feeds/videos.xml?channel_id=UCtvnB6R__6vdyjUEbDgAWHw"
          custom_tags: "channelId/yt:channelId/,videoId/yt:videoId/"
          date_format: "mmm d, yyyy"
          template: '<table><tr><td><a href="$url"><img width="140px" src="http://img.youtube.com/vi/$videoId/maxresdefault.jpg"></a></td>$newline<td><a href="$url">$title</a><br/>$date</td></tr></table>$newline'
          committer_email: "[email protected]"

Preview: https://github.com/Dexters-Hub/Dexters-Hub

Results

image

Latest Podcast Episode from Anchor
workflow.yml
name: Latest RadioGeek (Anchor)
on:
  schedule:
    # Runs “At 00:00 on Friday.”
    - cron: '0 0 * * FRI'
  workflow_dispatch:

jobs:
  update-readme-with-anchor:
    name: Update this repo's README with latest RadioGeek podcast feed from Anchor
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          comment_tag_name: "RadioGeek-Anchor-feed"
          feed_list: "https://anchor.fm/s/6048890/podcast/rss"
          max_post_count: 1000
          commit_message: "🔥Update with lastest RadioGeek feed"
          committer_username: "🤖RadioGeek-Bot"
          committer_email: "<>"
          date_format: 'UTC: yyyy-mm-dd'
          template: "$newline #### - [$title]($url) $newline <details><summary>توضیحات</summary> $description </details> $newline <hr /> $newline"
          # Regex for remove HTML TAG:    /(<([^>]+)>)/ig
          item_exec: "post.description = post.description.replace('','')"
          disable_html_encoding: true

by : Mahdi Qiamast

Results

01 02

Popular Sources

Some popular blogging platforms and their RSS feed URLs (Click to expand)
Name Feed URL Comments Example
Dev.to https://dev.to/feed/username Replace username with your own username https://dev.to/feed/gautamkrishnar
Wordpress https://www.example.com/feed/ Replace with your own blog url https://www.gautamkrishnar.com/feed/
Medium https://medium.com/feed/@username Replace username with your Medium username https://medium.com/feed/@khaosdoctor
Medium (Sub Domain) https://username.medium.com/feed Replace username with your Medium username https://timsneath.medium.com/feed
Stackoverflow https://stackoverflow.com/feeds/user/userid Replace with your StackOverflow UserId https://stackoverflow.com/feeds/user/5283532
StackExchange https://subdomain.stackexchange.com/feeds/user/userid Replace with your StackExchange UserId and sub-domain https://devops.stackexchange.com/feeds/user/15
Ghost https://www.example.com/rss/ Replace with your own blog url https://blog.codinghorror.com/rss/
Drupal https://www.example.com/rss.xml Replace with your own blog url https://www.arsenal.com/rss.xml
Hugo https://BASE_URL/post/index.xml Replace BASE_URL(doc) with your blog url. Refer to the official Hugo or your theme documentation for more info https://davidaparicio.gitlab.io/website/fr/post/index.xml
Youtube Playlists https://www.youtube.com/feeds/videos.xml?playlist_id=playlistId Replace playlistId with your own Youtube playlist id https://www.youtube.com/feeds/videos.xml?playlist_id=PLJNqgDLpd5E69Kc664st4j7727sbzyx0X
Youtube Channel Video list https://www.youtube.com/feeds/videos.xml?channel_id=channelId Replace channelId with your own Youtube channel id https://www.youtube.com/feeds/videos.xml?channel_id=UCDCHcqyeQgJ-jVSd6VJkbCw
Anchor.fm Podcasts https://anchor.fm/s/podcastId/podcast/rss You can get the rss feed url of a podcast by following these instructions https://anchor.fm/s/1e784a38/podcast/rss
Hashnode https://@username.hashnode.dev/rss.xml Replace @username with your Hashnode username https://polilluminato.hashnode.dev/rss.xml
Google Podcasts https://podcasts.google.com/feed/channelId Replace channelId with your Google podcast channel Id https://podcasts.google.com/feed/aHR0cHM6Ly9mZWVkcy5zb3VuZGNsb3VkLmNvbS91c2Vycy9zb3VuZGNsb3VkOnVzZXJzOjYyOTIxMTkwL3NvdW5kcy5yc3M=
Reddit http://www.reddit.com/r/topic/.rss You can create an RSS feed by adding '.rss' to the end of an existing Reddit URL. Replace topic with SubReddit topic that interest you or localized to you. http://www.reddit.com/r/news/.rss
Analytics India Magazine https://analyticsindiamag.com/author/author_name/feed/ Replace author_name with your name https://analyticsindiamag.com/author/kaustubhgupta1828gmail-com/feed/
Feedburner https://feeds.feedburner.com/feed_address Replace feed_address with your Feedburner feed address https://feeds.feedburner.com/darkwood-fr/blog
Tumblr https://blog_name.tumblr.com/rss or https://example.com/rss You can create an RSS feed by adding '/rss' to your main blog page or to your own domain if it is configured. Replace blog_name with your blog name https://goggledoddle.tumblr.com/rss
Blogger https://blog_name.blogspot.com/feeds/posts/default Replace blog_name with your blog subdomain https://singlebucks.blogspot.com/feeds/posts/default
Velog https://v2.velog.io/rss/userid Replace userid with your user id (without the @ symbol) https://v2.velog.io/rss/minnczi
Shouts.dev https://shouts.dev/feed/username Replace username with your own username https://shouts.dev/feed/obydul
Gist https://gist.github.com/username.atom Replace username with your own username https://gist.github.com/banyudu.atom
Tistory https://blog_name.tistory.com/rss Replace blog_name with your blog subdomain https://helicopter55.tistory.com/rss

Examples

FAQs and Common issues

  • Error Code 128
  • Looks like your website returned *XXX*, There is nothing blog post workflow can do to fix it. Please check your website's RSS feed generation source code. Also double check the URL.: This will happen if your website is blocking requests from the GitHUb IP addresses. It can also happen if you give the workflow an invalid URL. First, check your URL. If it's working fine on your computer, then try debugging it using https://github.com/marketplace/actions/debugging-with-tmate establish an ssh connection with the Github runner and try to curl -I <URL> This will give you a 200 status code if your website is responding correctly. If its not responding with 200, you need to check your website's feed generation source code, you can also contact your hosting provider/DNS provider to know if they are blocking the GitHub public IP address. Some companies do that to prevent spam and DDOS attacks. As the message says there is nothing I can do to fix this issue, it needs to be sorted out with your hosting provider.

Demo video

Please see the video by @codeSTACKr.

Contributing

Please see CONTRIBUTING.md for getting started with the contribution.

Make sure that you follow CODE_OF_CONDUCT.md while contributing and engaging in the discussions.

When contributing, please first discuss the change you wish to make via an issue on this repository before making the actual change.

ToDo

  • Add more sources
  • Fix bugs if any

Bugs

If you are experiencing any bugs, don’t forget to open a new issue.

Thanks to

jetbrains tutanota.com

Liked it?

Hope you liked this project, don't forget to give it a star ⭐.

chart

blog-post-workflow's People

Contributors

adityadees avatar adrianpaniagualeon avatar banyudu avatar curious-yu avatar curtiscde avatar davidaparicio avatar denvercoder1 avatar dependabot[bot] avatar gautamkrishnar avatar gkr-bot avatar hexxdump avatar kaustubhgupta avatar khaosdoctor avatar madushadhanushka avatar matyo91 avatar mdobydullah avatar michaelcurrin avatar minnczi avatar polilluminato avatar riginoommen avatar snyk-bot avatar tlowac avatar vadorequest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blog-post-workflow's Issues

[Feature]: Add WordPress sites in README

Is your feature request related to a problem? Please describe.
WordPress Blogs are more common nowadays, many people including me use it for blogging. It will be great to let people know that this workflow can fetch blogs from WordPress as well.

Describe the solution you'd like
It is more of a tip, just add /feed/ to your WordPress URL. For example, if my website is example.com, this Workflow can fetch the latest blogs from https://example.com/feed/

Example: My Workflow File

Result:
image

[Bug]: Error: Cannot find the comment tag on the readme:

Describe the bug
It is keep saying Error: Cannot find the comment tag on the readme:

Expected behavior
Should post successfully.

Screenshots
image
I have the section in my github readme
image
https://github.com/rupeshtiwari

Workflow Yml Used

name: Latest blog post workflow
on:
    schedule: # Run workflow automatically
      # This will make it run every hour
      - cron: '0 * * * *' 
     # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
    workflow_dispatch: 
jobs:
    update-readme-with-blog:
      name: Update this repo's README with latest blog posts
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v2
        - uses: gautamkrishnar/blog-post-workflow@master
          with:
            committer_username: rupeshtiwari
            readme_path: ./README.md
            committer_email: [email protected]
            # Replace this URL with your rss feed URL/s
            feed_list: "https://rupeshtiwari.github.io/feed.xml"
            gh_token: ${{ secrets.GH_TOKEN }}

Additional context

[Bug]: Push to repo after update von README.md fails (remote updates, pull first)

  1. Creating the action workflow
  2. Run the action
  3. pull and load the changes locally
  4. change the README.md locally
  5. commit and push to repo on Github
  6. Run the action

Result:

Run gautamkrishnar/blog-post-workflow@master
  with:
    max_post_count: 4
    feed_list: https://***.rss
    comment_tag_name: DISCOURSE
    template: - ($date) [$title]($url)$newline
    date_format: mmmm d, yyyy at h:MM TT
    commit_message: chore: update README.md with latest gohugo.io posts
    gh_token: ***
    readme_path: ./README.md
    disable_sort: false
    filter_comments: medium,stackoverflow/Comment by $author/,stackexchange/Comment by $author/
    user_agent: rss-parser
    accept_header: application/rss+xml
    committer_username: blog-post-bot
    committer_email: [email protected]
https://***.rss runner succeeded. Post count: 50
Writing to ./README.md
Started: git config --global user.email [email protected]
Started: git remote set-url origin https://***@***.git
Started: git config --global user.name blog-post-bot
Started: git add ./README.md
Started: git commit -m chore: update README.md with latest gohugo.io posts
[master bf1025a] chore: update README.md with latest gohugo.io posts
 1 file changed, 2 insertions(+), 2 deletions(-)
Started: git push
To https://***.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://***.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
(node:2466) UnhandledPromiseRejectionWarning: Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/gautamkrishnar/blog-post-workflow/master/dist/blog-post-workflow.js:116:945)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
(node:2466) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2466) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The action should pull first from the repo before it updates the README.md.

[Bug]: Error Code 128

I am getting the following error when I try to run this action with my RSS feed:

{"code":128,"outputData":""}

action.yml

      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://dohad.dev/feed.xml"

[SUGGESTION] A $videoid variable for the template property

This could be used to, for example, display the thumbnail of the video directly on the readme.md file, or can be used to get additional data about that video from youtube itself. Just a little thought I had while customizing my readme.md file with this.

[New Source]: Podcasts / Multiple Platforms

Source Name: Anchor
Source URL: https://anchor.fm/laii
Comments:

Podcasts are available on multiple platforms such as Google Podcasts/Spotify/Apple Podcasts etc. and Anchor distributes them to multiple platforms and also provides a link to all of them on the podcast's Anchor page.

We could fetch the links from any of the popular podcasting platforms or maybe from Anchor.fm itself, whatever is quicker to begin with.

[Bug]: Hugo links seem to not work?

Describe the bug
I'm trying to use this workflow on https://www.amitkohli.com/ this blog, which runs Hugo and is deployed through Netlify.

The RSS feed for this is: https://www.amitkohli.com/index.xml

To Reproduce
Steps to reproduce the behavior:

image

You can see my failed runs here: https://github.com/DataStrategist/DataStrategist/actions
Expected behavior
I would like to see the links to my latest blogposts in my front-page :)

Thanks for an excellent bit of software!

[Feature]: Hi,add bilibili videos list is useful

Is your feature request related to a problem? Please describe.
yes, i don't know how to add bilibili website videos in this workflow

Describe the solution you'd like
i need add bilibili web suppert in this workflow

Describe alternatives you've considered
none

Additional context
Add any other context or screenshots about the feature request here.

[Bug]: Error: {"code":1,"outputData":""}

Describe the bug
Since yesterday (2021-03-31 20:00), my blog-post-workflow action fails every hour, with this weird error:
Error: {"code":1,"outputData":""}

Expected behavior
The job should just succeed, even if there is nothing new to do

Screenshots
Screenshot_2021-04-01_05-52-19

Workflow Yml Used

name: Latest Tweets workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          # created from twitter search string:
          #   from:nil0x42 min_faves:5 min_retweets:2 -filter:retweets -filter:replies -filter:quote
          feed_list: "https://rss.app/feeds/x4n09N54uqkYSpaC.xml"
          comment_tag_name: LATEST-TWEETS
          item_exec: "post.title = post.title.replace(/(?:\\r\\n|\\r|\\n)/g,' ')"
          title_max_length: 80
          date_format: "mmm dd HH:MM"
          template: "<li>$date <a href='$url'>$title</a></li>$newline"
          tag_post_pre_newline: true
          commit_message: "blog-post-workflow/latest-tweets: update"
          committer_username: latest-tweets
          committer_email: [email protected]

Additional context
I've been using this exact workflow for many months and never got any error. And i didn't change anything in the code. But i couldn't figure out how this error started happening

[Bug]: youtube runner failed, please verify the configuration. Error 404

Describe the bug
I have a workflow that draws from Youtube. For many months, I have used it and it worked perfectly but now it seems to fail.
When I enter the link https://www.youtube.com/feeds/videos.xml?channel_id=XXXX in my browser, I get all my data.

Expected behavior
I expect the workflow to get the required contents and updated my README.md accordingly.

Screenshots
image

Workflow Yml Used

name: YouTube Videos
on:
  schedule:
    - cron: '0 * * * *'
  workflow_dispatch:

jobs:
  update-readme-with-youtube:
    name: Update this repo's README with latest videos from YouTube
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          comment_tag_name: "YOUTUBE"
          feed_list: "https://www.youtube.com/feeds/videos.xml?channel_id=XXX"

Note: The link has been double tested. There is no problem there.

[Bug]: Blog Workflow is not showing up in Actions, if it does, there is no Run workflow option

Describe the bug
Blog workflow is not showing up under the Actions. Sometimes it does showing up (after deleting it and adding), but there is no Run workflow option. But YouTube workflow is working fine.

To Reproduce
Steps to reproduce the behavior:

  1. Create a blog post workflow as mentioned in the instructions
  2. Go to Actions
  3. No workflow is getting displayed.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Profile: QAInsights

Desktop (please complete the following information):

  • OS: Win 10
  • Browser Firefox
  • Version 79.0

Smartphone (please complete the following information):
NA

Additional context
Add any other context about the problem here.

[Bug]: Shows wrong stats

Describe the bug

I added this workflow to my profile README but for some reason it doesn't show my morning commits to another repo and shows closed issues to my README repo (I closed them yesterday)

Expected behavior

I expected that it will show my commits.

Screenshots

Look at my profile README here

Workflow Yml Used

name: Update README

on:
  schedule:
    - cron: '*/30 * * * *'
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: Update this repo's README with recent activity

    steps:
      - uses: actions/checkout@v2
      - uses: jamesgeorge007/github-activity-readme@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Shower some emoji-love!?

Hi @gautamkrishnar,

Thanks for your work on this!

// Building with custom template
const date = dateFormat(cur.date, core.getInput('date_format')); // Formatting date
let content = template
.replace(/\$title\b/g, cur.title)
.replace(/\$url\b/g, cur.url)
.replace(/\$date\b/g, date)
.replace(/\$newline/g, '\n');

As I see it, the "Latest Blog Posts" section could you some emoji-love.
What I mean is, maybe we could use some emoji (at random from a pre-defined set) before the blog post. For example:

  1. 💯 [$title]($url)
  2. 🔥 [$title]($url)
  3. 💫 [$title]($url)
  4. 🚀 [$title]($url)
  5. 🌮 [$title]($url)

[Bug]: Run git pull

sometimes the ref pulling fails, before running git push do git pull to fix this

thanks

[Bug]: Attribute without value error

Describe the bug
Getting "Attribute without value" error on running the workflow.

Screenshots
image

Workflow Yml Used

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://medium.com/@akashthakur_15975"

[Bug]: Hashnode RSS Feed doesn't appear on GitHub Profile

I tried to use this workflow, in particular the standard blog-post-workflow.yml, to add to my GitHub profile my RSS feed on Hashnode.

Steps to reproduce the behavior

  1. Use the standard blog-post-workflow.yml as described in the readme file
  2. Add to the feed_list option my RSS feed on Hasnode: https://polilluminato.hashnode.dev/rss.xml
  3. Add the workflow_dispatch: option in the on section of the blog-post-workflow.yml as described in this video on YouTube by codeSTACKr
  4. Add the tag on my profile page
<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->
  1. Run manually the workflow on GitHub actions
  2. Nothing appears on my GitHub profile

My blog-post-workflow.yml

name: Lastest Hashnode Blog Post
on:
  schedule:
    # Runs every hour
    - cron: '0 * * * *'
  workflow_dispatch:

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest Hashnode blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          comment_tag_name: "HASHNODE"
          commit_message: "Updated readme with the latest Hashnode Blog data"
          feed_list: "https://polilluminato.hashnode.dev/rss.xml"

Expected behavior
I expected to see the list of the last 5 blog posts on Hashnode based on my RSS feed but nothing appears.

[Feature]: Implement retry functionallity

Is your feature request related to a problem? Please describe.
Retry functionallity

Describe the solution you'd like

  • Add additional argument named retry_count and retry_wait_time to the action options that allow user to do retry.

Additional context
This will be an intermittent solution for the issue like #65

[Feature]: Add option to filter by language

Is your feature request related to a problem? Please describe.
My blog supports multiple languages. All blog articles are available in two languages (en+de). This workflow shows all languages in my readme. I would like to filter by language, so only English articles are shown in my readme file.

Describe the solution you'd like
A new option "language: en" would be great. As you can see in the following XML code snippet, the blog post (entry) has an optional language parameter. If the new option would be set to en, only articles with this language should pass the filter.

<feed xmlns="http://www.w3.org/2005/Atom">
  ...
  <entry xml:lang="en">
    <title>First Videos of my Bikepacking in Germany 2020</title>
    ...
  </entry>
  ...
</feed>

Describe alternatives you've considered
I was thinking of creating the feed by language, but actually this is not possible, because I don't host the blog platform myself.

Additional context

error

Screenshot from 2020-09-07 20-40-30
what s the problem??

[Feature]: Add option to add date to template

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
I'd like to use $date in the template option, to add the post date on the list.

Describe alternatives you've considered
No one.

Additional context
Currently using WordPress source.

[Feature]: Having a template file and an output file

Is your feature request related to a problem? Please describe.

A lot of time, when I am working on the README.md of my profile I make change on my machine and, when I try to push, I have conflict to resolve for the blog section.

Describe the solution you'd like

I like to have an config for input path (like readme_path) and a output path.

If you have a input and output path you can have a TEMPLATE.md for input (with an empty section) and a README.md where the section for the blog is fill with what you want.

Feed sort

I'd like to make a feature request, sorry if this is the wrong place.

I'm using the workflow to pull youtube playlists feeds, and the feed is being sorted by the video date. It'd be great if we can choose to sort by when the video was added to the playlist, or sort randomly. Thank you.

[Feature]: Retrieve the "Description" or Custom field for each feed

Hi,

First thanks for creating this GitHub Action. It's really helpful !

Retrieve a field for each post
Is-it possible to retrieve a field like "Description" for each feed ?

Additional context
We would like to generate a newsletter based on multiple feeds. It would interesting if we could grab the "Description" field for each post to bring more info about the post.

[Bug]: Manual run of action triggers "UnhandledPromiseRejectionWarning: Error: Invalid status code: 128"

Describe the bug
As per title. The workflow succeeds, but the error is printed in the logs.

Expected behavior
Manual completes without errors.

Log

Run gautamkrishnar/[email protected]
https://khromov.se/feed/ runner succeeded. Post count: 5
Writing to ./README.md
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
Error on: git pull
(node:2452) UnhandledPromiseRejectionWarning: Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/gautamkrishnar/blog-post-workflow/1.3.9/dist/blog-post-workflow.js:116:946)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
(node:2452) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2452) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[main 9c2adf2] Updated with the latest blog posts
 1 file changed, 3 insertions(+)
To https://github.com/khromov/khromov.git
   85fbe2c..9c2adf2  main -> main
Readme updated successfully in the upstream repository

Workflow Yml Used

name: Latest blog post workflow
on:
  schedule:
    - cron: '0 */4 * * *' 
  workflow_dispatch:
jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/[email protected]
        with:
          feed_list: "https://khromov.se/feed/"
          max_post_count: 3

Additional context
Add any other context about the problem here.

[Feature]: Ignore StackOverflow comments

Is your feature request related to a problem? Please describe.
When you have an answer or a question it's usually the case where you have many comments too, so you only want to show the question or the answer.

Describe the solution you'd like
StackOverflow comments should not appear at all.

Describe alternatives you've considered
Maybe a filter for show/display them.

Additional context
Think like this but for StackOverflow #4.

p.s. I'd be happy to implement the solution and send a PR if you let me do it that.

[Bug]: Action workflow does not pull latest blogs posts from medium

Describe the bug
I have setup a cron expression to pull the latest blog posts from medium every hour, but it doesn't do so

Workflow Yml Used

name: Latest blog post workflow
on:
  schedule:
    # Runs every hour
    - cron: '0 * * * *'

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://medium.com/feed/@lakshyajit165"

Any help would be appreciated

[Bug]: Shows "$title"

Describe the bug

I changed my blog-posts template to $newline - $randomEmoji(💯,🔥,💫,🚀,🌮) [$title]($url) and in the last article it shows
$title <TITLE AND LINK> here you can see it.

Expected behavior

I expected that it will show smth like this:

Screenshots

https://user-images.githubusercontent.com/70339507/102758380-ba482880-4383-11eb-8a05-9bcaf954e4cb.png

Workflow Yml Used

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://dev.to/feed/dartcoder"
          template: "$newline - $randomEmoji(💯,🔥,💫,🚀,🌮) [$title]($url)"

Additional context

Thanks for helping.

[Feature]: Commit an empty commit when the last commit is before 50 days.

Is your feature request related to a problem? Please describe.
Right now GitHub will stop running the cron based trigger if there is no activity happening on the repo for the past 60 days.

Screenshot 2021-01-20 at 5 58 15 PM

Describe the solution you'd like
Committing an empty commit once in a while will prevent this behavior. I think calculating the time elapsed from the last commit's time and committing an empty commit if it is greater than 50 days would work as a fix.

Describe alternatives you've considered
n/a

Additional context
Ref: #52

[Feature]: Remove newlines from RSS post titles

Is your feature request related to a problem? Please describe.
I use a twitter RSS feed as input, and sometimes titles containg newlines, leading to improper markdown formatting.

Describe the solution you'd like
Replace occurences of \r\n & \n in the title by simple space

Describe alternatives you've considered
n/a

Additional context
Here's how titles get formatted:
Screenshot_2020-10-10_13-22-26
Screenshot_2020-10-10_13-21-04

[Bug]: Not detecting posts

For some reason this workflow isn't working for me and I'm not sure why...

Logs and RSS Feed:
image

README.MD
image

[Feature]: Add an option to set title max-length

Is your feature request related to a problem? Please describe.
Some RSS sources (such as twitter) may include too long post titles.

Describe the solution you'd like
Adding an option to set a max-length to post titles would be a cool feature

Describe alternatives you've considered
When title has to be truncated, a triple-dot can be added to the end of string to make clear the title has been truncated

Additional context
RSS from last tweets (formatted by rss.app) have very long titles:
Screenshot_2020-10-10_13-22-26

[Bug]: Response 406 when asking for rss stream

Describe the bug
When I use the provided configuration and the cronjob runs I get a 406 Not Acceptable response in the github action as an error.

To Reproduce
Steps to reproduce the behavior:

  1. Implement Github Action as described
  2. Let the job run with feed_list: "https://offeringsolutions.azurewebsites.net/index.xml" or "https://offering.solutions/index.xml"
  3. See the 406 Error
Run gautamkrishnar/blog-post-workflow@master
  with:
    feed_list: https://offeringsolutions.azurewebsites.net/index.xml
    gh_token: ***
    readme_path: ./README.md
    max_post_count: 5
    disable_sort: false
    filter_comments: medium,stackoverflow/Comment by $author/,stackexchange/Comment by $author/
    template: default
    commit_message: Updated with the latest blog posts
    committer_username: blog-post-bot
    committer_email: [email protected]
##[error]https://offeringsolutions.azurewebsites.net/index.xml runner failed, please verify the configuration. Error:
##[error]Error: Status code 406
0 blog posts fetched

Expected behavior
I would hav eexpected to read the xml and show the latest blogposts.

Screenshots
None

Additional context
"https://offering.solutions/index.xml" is running behind cloudflare, "https://offeringsolutions.azurewebsites.net/index.xml" is not, both of them return a 406

[Bug]: Attribute without value error

Describe the bug
Getting "Attribute without value" error on running the workflow.

Screenshots
image

Workflow Yml Used

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://medium.com/@akashthakur_15975"

[Bug]: Feed can't be read from github.io repo rss

Describe the bug
Set up workflow as in your repo (with the only difference that link to feed changed)

Expected behavior
Feed is parsed and shown on Readme successfully

Workflow Yml Used

name: Latest blog post workflow
on:
  schedule:
    # Runs every hour
    - cron: '0 * * * *'
  workflow_dispatch:

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          max_post_count: "4"
          feed_list: "https:/krossovochkin.github.io/index.xml"

Error says:

Error: https:/krossovochkin.github.io/index.xml runner failed, please verify the configuration. Error:
Error: Error: connect ECONNREFUSED 127.0.0.1:443

https://github.com/krossovochkin/krossovochkin/runs/1442964262?check_suite_focus=true

Thank you

problem with custom domain github.io page

When I add the feed of my website, the links generated are:
https://github.com/Abhiswain97/Abhiswain97/blob/master/abhishekswain.me/machine%20learning/maths/2020/07/28/Logistic_regression-Copy1.html

whereas it should just be abhishekswain.me/machine%20learning/maths/2020/07/28/Logistic_regression-Copy1.html

It adds extra https://github.com/Abhiswain97/Abhiswain97/blob/master/ to URL. Why?

My readme: Abhiswain97
My website: https://abhishekswain.me/

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.