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

[Feature]: Set the list generated as an output variable so that other actions can consume it #51

Closed
gautamkrishnar opened this issue Jan 11, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@gautamkrishnar
Copy link
Owner

the list generated as an output variable so that other actions can consume it and can do stuff with the data.

Add a flag to set this. Prevent commit to readme if this flag is present.

@gautamkrishnar gautamkrishnar added the enhancement New feature or request label Jan 11, 2021
@gautamkrishnar
Copy link
Owner Author

@gautamkrishnar
Copy link
Owner Author

gautamkrishnar commented Jan 12, 2021

The output format will be as follows:

Workflow yaml

name: Latest blog post workflow
on:
  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
        id: blog-post-workflow
        with:
          feed_list: "https://www.feedforall.com/sample.xml"
          max_post_count: 2
          output_only: true
      - run: echo  ${{ steps.blog-post-workflow.outputs.results }}

Results output variable

[
   {
      "title":"RSS Solutions for Restaurants",
      "url":"http://www.feedforall.com/restaurant.htm",
      "description":"<b>FeedForAll </b>helps Restaurant's communicate with customers. Let your customers know the latest specials or events.<br>\r\n<br>\r\nRSS feed uses include:<br>\r\n<i><font color=\"#FF0000\">Daily Specials <br>\r\nEntertainment <br>\r\nCalendar of Events </i></font>",
      "date":"2004-10-19T15:09:11.000Z"
   },
   {
      "title":"RSS Solutions for Schools and Colleges",
      "url":"http://www.feedforall.com/schools.htm",
      "description":"FeedForAll helps Educational Institutions communicate with students about school wide activities, events, and schedules.<br>\r\n<br>\r\nRSS feed uses include:<br>\r\n<i><font color=\"#0000FF\">Homework Assignments <br>\r\nSchool Cancellations <br>\r\nCalendar of Events <br>\r\nSports Scores <br>\r\nClubs/Organization Meetings <br>\r\nLunches Menus </i></font>",
      "date":"2004-10-19T15:09:09.000Z"
   }
]

You can use tools like jq to read values from the ouput variable. Explaining how to do that is beyond the scope of this project.

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

1 participant