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

[Bug]: TypeError: Cannot convert object to primitive value #208

Closed
RobThree opened this issue Apr 15, 2023 · 6 comments
Closed

[Bug]: TypeError: Cannot convert object to primitive value #208

RobThree opened this issue Apr 15, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@RobThree
Copy link

Describe the bug
I'm getting Error: TypeError: Cannot convert object to primitive value.

Expected behavior
I expected the RSS feed to load and be processed correctly 😃

Screenshots
Screenshot 2023-04-15 at 11 18 41

Workflow Yml Used

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 0 * * *' # Runs every midnight
  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:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Pull in posts
        uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://blog.robiii.nl/feeds/posts/default?alt=rss"
          template: "<li><a href=\"$url\" target=\"_blank\" title=\"UTC: $date\">$title</li>"
          max_post_count: 10

Additional context
Here is the debug log:

##[debug]Evaluating condition for step: 'Pull in posts'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Pull in posts
##[debug]Loading inputs
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run gautamkrishnar/blog-post-workflow@master
  with:
    feed_list: https://blog.robiii.nl/feeds/posts/default?alt=rss
    template: <li><a href="$url" target="_blank" title="UTC: $date">$title</li>
    max_post_count: 10
    gh_token: ***
    readme_path: ./README.md
    disable_sort: false
    filter_comments: medium,stackoverflow/Comment by $author/,stackexchange/Comment by $author/
    date_format: UTC:ddd mmm dd yyyy h:MM TT
    user_agent: rss-parser
    accept_header: application/rss+xml
    commit_message: Updated with the latest blog posts
    committer_username: blog-post-bot
    committer_email: [email protected]
    output_only: false
    enable_keepalive: true
    retry_count: 0
    retry_wait_time: 1
    disable_html_encoding: false
    categories_template: default
    disable_item_validation: false
    skip_commit: false
::add-mask::***
https://blog.robiii.nl/feeds/posts/default?alt=rss runner succeeded. Post count: [2](https://github.com/RobThree/RobThree/actions/runs/4705071732/jobs/8348709833#step:3:2)[4](https://github.com/RobThree/RobThree/actions/runs/4705071732/jobs/8348709833#step:3:4)
Error: TypeError: Cannot convert object to primitive value
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Pull in posts

I have no idea what the Cannot convert object to primitive value is referring to. I hope you can point me in the right direction or instruct me how to debug this issue.

Thanks!

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

@RobThree this is mainly due to this:

         <category domain="http://www.blogger.com/atom/ns#">C#</category>
         <category domain="http://www.blogger.com/atom/ns#">Controller</category>
         <category domain="http://www.blogger.com/atom/ns#">Ordering</category>
         <category domain="http://www.blogger.com/atom/ns#">Sorting</category>
         <category domain="http://www.blogger.com/atom/ns#">Swagger</category>
         <category domain="http://www.blogger.com/atom/ns#">Swashbuckle</category>

your RSS feed is sending categories like this

@RobThree
Copy link
Author

Ok. I'm sorry for my ignorance, but, what should it look like / be then?

@gautamkrishnar
Copy link
Owner

gautamkrishnar commented Apr 15, 2023

@RobThree nevermind, I just read through the RSS spec docs looks like this is also a valid case. Will try to add a fix for this. https://validator.w3.org/feed/docs/rss2.html#ltcategorygtSubelementOfLtitemgt

@RobThree
Copy link
Author

RobThree commented Apr 15, 2023

That would be amazing! Thank you! Much appreciated!

(Also: I think blogger must've changed something yesterday then - I haven't changed anything)

@gautamkrishnar
Copy link
Owner

@RobThree fix for this is now released on https://github.com/gautamkrishnar/blog-post-workflow/releases/tag/1.8.4 Thanks for reporting this. There is no action is required from your end it will automatically work the next time when it runs.

@RobThree
Copy link
Author

Screenshot 2023-04-15 at 18 07 07

All green! 🚀

Thanks! That was amazing and super quick! Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants