Code Monkey home page Code Monkey logo

parse-issue's Introduction

Actions Issue Parser

Extract useful information from new issues for use in your GitHub Actions.

Getting Started

Simply add this action to any workflow that runs on GitHub Issue created events and it will extract key: value pairs as outputs to be used in subsequent actions.

This parser will replace whitespace and special characters with _, then squash repeating _ down to one, dropping any leading or trailing _

Email of User would become email_of_user

Example Workflow

- id: parser
  uses: actionsdesk/parse-issue@v1
- uses: actions/some-action@v1
  with:
    foo: ${{steps.parser.outputs.foo}}
    bar: ${{steps.parser.outputs.bar}}

Example Issue

# Welcome

foo: fizz
bar: buzz

Given the workflow and issue above, this action will parse foo and bar with their values and make them available at steps.parser.outputs. In this example, the following would be defined:

  • steps.parser.outputs.foo (with a value of fizz)
  • steps.parser.outputs.bar (with a value of buzz)

The id used is arbitrary, only used to reference the output in another step.

Default Extractor

By default, this Action will extract all key: value pairs that it finds. Duplicate keys will be overridden by the last value found.

Custom Extractors

You can define custom extractors with regular expressions by defining inputs to this action in a specific prefix. All inputs that start with extract_ will be enumerated and made available on outputs based on the value passed in. If you use a capture group, we will assign the first match and ignore the rest

Examples

Workflow Issue Result
uses: actionsdesk/parse-issue@v1
inputs:
  extract_username: '<p id="username">(?<username>[^<]+)</p>'
  extract_email: '<p id="email">[email protected]</p>'
# Example Issue
<p id="username">johnsmith</p>
<p id="username">(?<email>[^<]+)</p>
username: johnsmith
email: [email protected]
uses: actionsdesk/parse-issue@v1
inputs:
  extract_awesome: '^(.+) is awesome!$'
# Example Issue
Everything is awesome!
awesome: Everything

parse-issue's People

Contributors

jasonmacgowan avatar froi avatar dependabot[bot] avatar

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.