Code Monkey home page Code Monkey logo

rss-issues-action's Introduction

RSS issues action

This action create issues from a syndication feed (RSS or Atom).

Inputs

repo-token

Required the GITHUB_TOKEN secret.

feed

Required URL of the rss.

prefix

Prefix added to issues.

lastTime

Limit items date.

labels

Labels to add, comma separated.

dry-run

Log issue creation but do nothing

aggregate

Aggregate all items in a single issue

characterLimit

Limit size of issue content

titleFilter

Don't create an issue if the title matches the specified regular expression (go regular expression syntax)

contentFilter

Don't create an issue if the content matches the specified regular expression (go regular expression syntax)

Outputs

issues

Issues number, comma separated.

Example

step

uses: guilhem/rss-issues-action
with:
  repo-token: ${{ secrets.GITHUB_TOKEN }}
  feed: "https://cloud.google.com/feeds/kubernetes-engine-release-notes.xml"

complete

name: rss

on:
  schedule:
    - cron: "0 * * * *"

jobs:
  gke-release:
    runs-on: ubuntu-latest
    steps:
      - name: rss-issues
        uses: guilhem/[email protected]
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          feed: "https://cloud.google.com/feeds/kubernetes-engine-release-notes.xml"
          prefix: "[GKE]"
          characterLimit: "255"
          dry-run: "false"
          lastTime: "92h"
          labels: "liens/Kubernetes"

Real Usage

rss-issues-action's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rss-issues-action's Issues

allow "aggregated" issue creation

Add option that, instead of creating few separate issues, would make the action create single issue with list/checklist of rss updates.

SiGSEV on rss+xml Ubuntu feed

Hello!

I'm trying to use the action in the repository (thanks for sharing) although I'm receiving a SIGSEV that I'm not able to know the root cause of it (limited Go knowledge sorry).

My testing setup is for checking nvidia package updates on Ubuntu Focal is as follow:

Run guilhem/[email protected]
  with:
    repo-token: ***
    feed: https://packages.ubuntu.com/focal/updates/newpkg?format=rss
    prefix: [Ubuntu Focal Nvidia 2022-05-02]
    characterLimit: 255
    dry-run: false
    lastTime: 24h
    labels: ubuntu
    titleFilteR: .*nvidia-graphics-drivers-390.*
/usr/bin/docker run --name ghcrioguilhemrssissuesaction051_f0b8b7 --label 294b31 --workdir /github/workspace --rm -e INPUT_REPO-TOKEN -e INPUT_FEED -e INPUT_PREFIX -e INPUT_CHARACTERLIMIT -e INPUT_DRY-RUN -e INPUT_LASTTIME -e INPUT_LABELS -e INPUT_TITLEFILTER -e INPUT_AGGREGATE -e INPUT_CONTENTFILTER -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/security-advisories/security-advisories":"/github/workspace" ghcr.io/guilhem/rss-issues-action:0.5.1
New Ubuntu Packages
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7c36a7]

goroutine 1 [running]:
main.main.func1(0x1?)
	/src/main.go:102 +0x27
reflect.Value.call({0x7fb5a0?, 0xc000451c00?, 0xc0001859d8?}, {0x88320c, 0x4}, {0xc000185af0, 0x1, 0xc000185a08?})
	/usr/local/go/src/reflect/value.go:556 +0x845
reflect.Value.Call({0x7fb5a0?, 0xc000451c00?, 0x0?}, {0xc000185af0, 0x1, 0x1})
	/usr/local/go/src/reflect/value.go:339 +0xbf
github.com/thoas/go-funk.Filter({0x7eed40?, 0xc00048f9c8}, {0x7fb5a0?, 0xc000451c00})
	/go/pkg/mod/github.com/thoas/[email protected]/presence.go:41 +0x337
main.main()
	/src/main.go:101 +0x627

Am I doing some wrong with the configuration? Thanks!

Doesn't work if labels are not specified

If I don't include the labels field with this action, creating the issue fails with:

Warning: Fail create issue <ISSUE TITLE>: POST https://api.github.com/repos/<ORG>/<REPO>/issues: 422 Validation Failed [{Resource:Label Field:name Code:missing_field Message:}]

This seems to be due to always including the labels in the new issue request, even though it may be empty:

rss-issues-action/main.go

Lines 187 to 191 in 09f7548

issueRequest := &github.IssueRequest{
Title: &title,
Body: &body,
Labels: &labels,
}

I was able to work around this by configuring the action to add a label with the labels field.

Option to limit number of characters in the body of the issue [characterLimit]

It would be interesting if you had the option of not bringing all the text of the article, but just a few characters and a 'Read more: www.xpto.com'
RSS is bringing all the content from all the sites, and that ends up taking away the article's view.

My sugestion:

Create characterLimit options.

  • Default value: 0
    • If the person does not enter a value other than 0, they will continue to create an issue with all the content of the article, which is the current behavior.
  • If the person reports a value above 0, actions will create the issue with the number of characters defined, 3 points at the end (...) and the footer Read more: XXX.

Workflow Example:

on:
  schedule:
    - cron: "0 11 * * *"

jobs:

  AssertQA:
    runs-on: ubuntu-latest
    steps:
      - uses: guilhem/[email protected]
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          feed: "https://medium.com/feed/assertqualityassurance"
          lastTime: "25h"
          labels: "AssertQA,RSS"
          characterLimit: 250

Issue example:

Hello guys,
Continuing on reviewing some performance test tools, today is the turn of Jmeter and Gatling, which looks like more and more people are using nowadays. Remember always check your other options and see what better fits for your project...

Read more: https://azevedorafaela.com/2020/06/22/load-tests-jmeter-vs-gatlin/

Convert to Javascript?

I noticed that this Action gobbled up my minutes rather quickly. So I gave it a try to convert it to Javascript, and it is a lot faster (less than 20 seconds, when the Docker-based version typically takes about one and a half minutes).

You can find the current state here: https://github.com/guilhem/rss-issues-action/compare/dscho:switch-to-javascript

I do understand that this conversion might cause more problems than it solves (because regular expression syntax differs between Go and Javascript), so I am prepared to hear the answer "No" to the question whether I should open a Pull Request.

At the same time, I also noticed that some input parameters are kebap-cased, others are camelCased (I plan on addressing this while at it).

Oh, and I also noticed that the current Go code has a bug: while it declares the aggregate input correctly, the actual code looks for aggragate, which of course does not exist (notice the a in the second syllable).

notify user

add assignees/notify field so that it is possible to ping a particular user(s)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.