Skip to content

blavity/smartformat-validate-action

Repository files navigation

smartformat-validate-action

GitHub Action to validate RSS feeds against the SmartNews SmartFormat v2.1 specification.

Usage

- uses: blavity/smartformat-validate-action@v1
  with:
    feed_urls: '["https://example.com/rss.xml", "https://example.com/tech/rss.xml"]'

Inputs

Input Required Default Description
feed_urls yes JSON array of RSS feed URLs to validate
min_item_count no 5 Minimum number of <item> elements required per feed
max_age_hours no 48 Max hours since <lastBuildDate> before a staleness warning. Set to 0 to disable.
require_snf_namespace no true Require xmlns:snf="http://www.smartnews.be/snf" namespace declaration

Outputs

Output Description
result pass or fail
feeds_passed Number of feeds that passed all hard checks
feeds_failed Number of feeds that failed one or more hard checks

What gets validated

Hard failures (action exits non-zero)

Channel level:

  • <title>, <link>, <description> present

Item level (per item):

  • <title>, <link>, <guid>, <pubDate> present
  • <content:encoded> present
  • <media:thumbnail> present (required per SmartFormat v2.1 spec)

Feed level:

  • Item count ≥ min_item_count
  • snf: namespace declared (when require_snf_namespace: true)

Warnings (surfaced in step summary, do not fail)

  • <lastBuildDate> older than max_age_hours
  • <snf:logo> absent from channel (recommended for branding)
  • Item <description> absent (recommended per spec)

Step summary

Each run writes a Markdown table to $GITHUB_STEP_SUMMARY with per-feed pass/fail status and a direct link to the SmartNews Validator for each URL.

Example — post-deploy smoke test

jobs:
  deploy:
    runs-on: ubuntu-24.04
    steps:
      - name: Deploy
        run: echo "deploy step here"

  rss-smoke-test:
    needs: deploy
    runs-on: ubuntu-24.04
    steps:
      - uses: blavity/smartformat-validate-action@v1
        with:
          feed_urls: '["https://example.com/rss.xml", "https://example.com/tech/rss.xml"]'

Versioning

Pin to a major tag (@v1) for stability. See releases for the changelog.

Contributing

See CONTRIBUTING.md.

Trademarks

SmartNews and SmartFormat are trademarks or registered trademarks of SmartNews, Inc. Blavity, Inc. is not affiliated with, endorsed by, or sponsored by SmartNews, Inc. All other trademarks are the property of their respective owners.

License

MIT — see LICENSE.

About

GitHub Action to validate RSS feeds against the SmartNews SmartFormat v2.1 specification

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages