Giter Site home page Giter Site logo

init-action's Introduction

Init-action

This action is used for one time automation after repository creation. This will utilize dispatcher webhook for handling custom event payload.

Usage

See action.yml, init-workflow

on: repository_dispatch
jobs:
  init: # make sure the action works on a clean machine without building
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: carbohydrates/init-action@v3
        with:
          destroy_after_execution: 'false'

Triggering the action

This action is triggered by custom API call https://help.github.com/en/actions/reference/events-that-trigger-workflows#external-events-repository_dispatch.

Note: This event will only trigger a workflow run if the workflow file is on the master or default branch.

{
    "event_type": "init_action", 
    "client_payload": {
        "files": ["**/*.yaml"],
        "ignores": [],
        "toReplace": {
            "__PLACEHOLDER1__": "someValue1",
            "__PLACEHOLDER2__": "someValue2",
            "_placeholder1__" : "yaaaay"
        }
    }
}
Name Type description
event_type string Required: A custom webhook event name.
client_payload object JSON payload with extra information about the webhook event that your action or worklow may use.
client_payload.files string[] Array of the file patterns that should be used for processing
client_payload.ignores string[] Array of the file patterns that should be excluded from processing
client_payload.toReplace {[key: string]: string} Map of k,v where k replacing placeholder and v is value for this replacement
curl --request POST \
  --url https://api.github.com/repos/carbohydrates/init-action/dispatches \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '{"event_type":"init_action","client_payload":{"files":["**/*.yaml"],"ignores":[],"toReplace":{"__PLACEHOLDER1__":"someValue1","__PLACEHOLDER2__":"someValue2","_placeholder1__":"yaaaay"}}}'

NOTE: For private repos you should use Basic Auth with private access token

init-action's People

Contributors

carbohydrates avatar ibmr avatar

Stargazers

 avatar  avatar  avatar  avatar  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.