Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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]: Fails when there is no <title> in <item> #205

Closed
nie7321 opened this issue Apr 11, 2023 · 1 comment
Closed

[Bug]: Fails when there is no <title> in <item> #205

nie7321 opened this issue Apr 11, 2023 · 1 comment

Comments

@nie7321
Copy link

nie7321 commented Apr 11, 2023

Describe the bug
When there is no <title> in an RSS feed's <item>, the action fails:

            title: item.title.trim(),
                              ^

TypeError: Cannot read properties of undefined (reading 'trim')

Expected behavior
The RSS file in question is from a microblogging site. It's a valid RSS 2.0 file. Per the RSS 2.0 specification:

All elements of an item are optional, however at least one of title or description must be present.

In this feed, <title> is absent, but <description> is available:

    <item>
      <guid isPermaLink="true">https://mastodon.yshi.org/@owls/110177333762426246</guid>
      <link>https://mastodon.yshi.org/@owls/110177333762426246</link>
      <pubDate>Tue, 11 Apr 2023 00:24:55 +0000</pubDate>
      <description>&lt;p&gt;!deer&lt;/p&gt;</description>
    </item>

If you would like to see the whole feed, it is available at https://mastodon.yshi.org/@owls.rss.

Screenshots
If applicable, add screenshots to help explain your problem.

Workflow Yml Used

name: Dynamic README
on:
  schedule:
    - cron: '0 * * * *'
  workflow_dispatch:
permissions:
  contents: write

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@v3
      - name: Pull in Blog Posts
        uses: gautamkrishnar/blog-post-workflow@v1
        with:
          feed_names: "owlblog,microblog"
          feed_list: "https://godless-internets.org/feed/,http://mastodon.yshi.org/@owls.rss"
@nie7321 nie7321 added the bug Something isn't working label Apr 11, 2023
@gautamkrishnar
Copy link
Owner

@nie7321 title check can be disabled by setting disable_item_validation also you can skip items that don't have a title via item_exec read more about that in the options list: https://github.com/gautamkrishnar/blog-post-workflow#options

You can use a combination of templates combined with the above options to make the workflow work.
ex: #142 and #34 (comment)

@gautamkrishnar gautamkrishnar removed the bug Something isn't working label Apr 11, 2023
Repository owner locked and limited conversation to collaborators Apr 11, 2023
@gautamkrishnar gautamkrishnar converted this issue into discussion #206 Apr 11, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants