Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 1.65 KB

README.md

File metadata and controls

66 lines (49 loc) · 1.65 KB

@ubiquity-os/daemon-responder

This plugin is designed to respond to issues with a predefined message. It is useful for no-reply repositories, where users are directed to a different platform for support or to a parent repository for issues etc.

Getting Started

  1. Clone and install dependencies.
bun install
  1. Define your plugin's settings.
plugins:
  - uses:
      - plugin: http://localhost:4000
        with:
          automatedResponses:
            "daemon-responder": "This is a no-reply repo, please visit the link in the issue description. Thank you!"
  1. Launch the plugin.
bun worker
  1. Launch the kernel (in Kernel repository).
bun dev
  1. Test your plugin by commenting on an issue you defined in step two.

Worker Plugins

  • bun worker - to run the worker locally.
  • To trigger the worker, POST requests to http://localhost:4000/ with an event payload similar to:
await fetch("http://localhost:4000/", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    stateId: "",
    eventName: "",
    eventPayload: "",
    settings: "",
    ref: "",
    authToken: "",
  }),
});

A full example can be found here.

Deploying the Worker

For testing purposes, the worker can be deployed through the Worker Deploy and Worker Delete workflows. It requires to create a personal Cloudflare Account, and fill the CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN within your GitHub Action Secrets.