Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action throws error after Update #210

Closed
kristofzerbe opened this issue Apr 20, 2023 · 4 comments
Closed

Action throws error after Update #210

kristofzerbe opened this issue Apr 20, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@kristofzerbe
Copy link

Describe the bug
With the new version 5 days ago, my action using blog-postworkflow throws the error Error: TypeError: Cannot convert object to primitive value.

Expected behavior
Run without error

Workflow Yml Used

name: Latest blog post workflow # https://github.com/gautamkrishnar/blog-post-workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 12 * * *' # Runs on 12h 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-latest-posts:
    name: Update this repo's README with latest blog posts from kiko.io
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Pull in posts
        uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://kiko.io/atom.xml"
          max_post_count: 6
          date_format: UTC:dd mmm yyyy
          custom_tags: "thumbImage/media:thumbnail/" #Issue: https://github.com/gautamkrishnar/blog-post-workflow/issues/28
          template: $newline - [$title]($url)   $newline $date   $newline 

Additional context
My config doesn't changed

@kristofzerbe kristofzerbe added the bug Something isn't working label Apr 20, 2023
@gautamkrishnar
Copy link
Owner

gautamkrishnar commented Apr 24, 2023

@kristofzerbe you were using custom_tags wrongly. It was never intended to be used this way. Simply remove that line and it should work.

Custom tags are supposed to work with:

<entry>
<id>yt:video:DPnJldwv22o</id>
<yt:videoId>DPnJldwv22o</yt:videoId>
<yt:channelId>UCDCHcqyeQgJ-jVSd6VJkbCw</yt:channelId>
<title>FREE Icons! How to use Bootstrap Icons v1.0.0 | Bootstrap 5 (2020)</title>
<link rel="alternate" href="https://www.youtube.com/watch?v=DPnJldwv22o"/>
<author>
<name>codeSTACKr</name>
<uri>https://www.youtube.com/channel/UCDCHcqyeQgJ-jVSd6VJkbCw</uri>
</author>
<published>2020-09-05T14:00:02+00:00</published>
<updated>2020-09-07T16:48:52+00:00</updated>
<media:group>
<media:title>FREE Icons! How to use Bootstrap Icons v1.0.0 | Bootstrap 5 (2020)</media:title>
<media:content url="https://www.youtube.com/v/DPnJldwv22o?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
<media:thumbnail url="https://i1.ytimg.com/vi/DPnJldwv22o/hqdefault.jpg" width="480" height="360"/>
<media:description>👉 Sign up for my newsletter to stay up-to-date on my new course: https://codestackr.com Did you know that Bootstrap has its own icon library? Apparently, they released the first stable version, 1.0.0, last week. In this video, we'll look at how we can implement these with any of our projects even if we are not using Bootstrap. That's right! You can use these independent of Bootstrap. Bootstrap 5 is not required. Since these are MIT licensed and they are just SVGs, we can use them anywhere for FREE! Let me know what you think. Website: https://icons.getbootstrap.com/ Timestamps: 00:00 - Introduction 00:34 - Installation 01:34 - Embedding 03:07 - Sprite 04:34 - External Image 06:26 - CSS 08:32 - Style _____________________________________ 💖 Show support! PayPal: https://paypal.me/codeSTACKr _____________________________________ Watch Next: Web Development - Beginners Roadmap (2020) - https://youtu.be/iogabydg2y0 Playlist: Web Development For Beginners - https://www.youtube.com/watch?v=Ez4yHS2dsN8&list=PLkwxH9e_vrAJ0WbEsFA9W3I1W-g_BTsbt _____________________________________ Connect With Me: Website: http://www.codestackr.com Twitter: https://twitter.com/codeSTACKr Instagram: https://instagram.com/codeSTACKr Facebook: https://facebook.com/codeSTACKr _____________________________________ ** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you. #codeSTACKr #bootstrap5 #icons</media:description>
<media:community>
<media:starRating count="346" average="4.95" min="1" max="5"/>
<media:statistics views="6093"/>
</media:community>
</media:group>
</entry>
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://example.com/feeds"
          custom_tags: "channelId/yt:channelId/,videoId/yt:videoId/"
          template: [$title]($url) $channelId $videoId

You are trying access:

<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://kiko.io/images/social-media/Discoveries-23-UI-CSS.thumb.png" height="1200" width="630"/>

Which is not supported by customTags. It doesn't support this tag with an attribute. it only suports:

<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="1200" width="630">https://kiko.io/images/social-media/Discoveries-23-UI-CSS.thumb.png</media:thumbnail>

@gautamkrishnar gautamkrishnar removed the bug Something isn't working label Apr 24, 2023
@gautamkrishnar gautamkrishnar added the enhancement New feature or request label Apr 24, 2023
@gautamkrishnar
Copy link
Owner

@kristofzerbe Looks like this is achievable via the current version of the feed parser. Will try to implement this feature when I have time. I recently upgraded the feed parser library. It is breaking due to that. Since this is an uncommon use case, most people won't see any issues using the workflow.

@gautamkrishnar
Copy link
Owner

@kristofzerbe if possible can you please rebase the PR you opened here rbren/rss-parser#224 it would easier if we have the code in the rss feed parser upstream instead of this project.

@gautamkrishnar
Copy link
Owner

Closing this since this is not a common use case. Will take a look at this once rbren/rss-parser#224 is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants