Giter VIP home page Giter VIP logo

payload-info-action's Introduction

Payload Info

This action extracts info from the webhook payload object in Github Actions using filters based on the jq tool. It also provides the name of the branch this workflow is running on and if it is a pull request or not.

Check out the .github/workflows/main.yml file to see this action working.

Inputs

filter_push

Required Filter to be applied to the webhook payload object in case of a push. Default ".".

Learn more about filters at the jq manual.

filter_pull_request

Filter to be applied to the webhook payload object in case of a pull request. Default ".pull_request.".

Learn more about filters at the jq manual.

filter_prefix

String to be prefixed to all filters. Default ".[]".

dump

If the webhook payload should be dumped as a JSON file or not. Default true.

dump_path

Path to the JSON file that will house the dumped webhook payload. Default "gh-payload.json".

print

If the webhook payload should be output. Default true.

Outputs

value

Result of the filter applied to the webhook payload. If this the workflow is on a regular push (not pull request), value contains the result of the filter_push filter. If the workflow is on a pull request, value contains the result of the filter_pull_request filter.

branch

Name of the branch related to this workflow, e.g. "master".

pull_request

If this workflow is running on a pull request or not, e.g. "false".

Example usage

- uses: Dovyski/payload-info-action@master
  with:
    filter_push: '.commits[].author'
    filter_pull_request: '.pull_request.commits'

payload-info-action's People

Contributors

dovyski avatar nataliaoliveira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

payload-info-action's Issues

payload

  • uses: Dovyski/payload-info-action@master
    with:
    filter_push: '.commits[].author'
    filter_pull_request: '.pull_request.commits'

Error: Cannot find module '@actions/core'



Error: Cannot find module '@actions/core'
Require stack:
- /home/manobo/temp/actions-runner/_work/_actions/Dovyski/payload-info-action/v1/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/manobo/temp/actions-runner/_work/_actions/Dovyski/payload-info-action/v1/index.js:1:14)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/manobo/temp/actions-runner/_work/_actions/Dovyski/payload-info-action/v1/index.js'
  ]
}

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.