Skip to content

Latest commit

 

History

History
72 lines (47 loc) · 1.52 KB

README.md

File metadata and controls

72 lines (47 loc) · 1.52 KB

Snap-in to perform an external action

Snap-in that mirrors an issue from DevRev to GitHub. This introduces a command which can be used to replicate the issue in the specific repository.

To run the command :

/gh_issue OrgName RepoName

Testing locally

You can test your code by adding test events under src/fixtures similar to the example event provided. You can add keyring values to the event payload to test API calls as well.

Once you have added the event, you can test your code by running:

npm install
npm run start -- --functionName=command_handler --fixturePath=on_command.json

Adding external dependencies

You can also add dependencies on external packages in package.json under the “dependencies” key. These dependencies will be made available to your function at runtime and testing.

Linting

To check for lint errors, run the following command:

npm run lint

To automatically fix lint errors, run:

npm run lint:fix

Activating Snap-Ins

Once you are done with the testing, run the following commands to activate your snap_in:

  1. Authenticate to devrev CLI
devrev profiles authenticate --org <devorg name> --usr <user email>
  1. Create a snap_in_version
devrev snap_in_version create-one --path <template path> --create-package
  1. Draft the snap_in
devrev snap_in draft
  1. Update the snap_in
devrev snap_in update
  1. Activate the snap_in
devrev snap_in activate