Skip to content

Latest commit

 

History

History
68 lines (60 loc) · 3.21 KB

README.md

File metadata and controls

68 lines (60 loc) · 3.21 KB

Actions

Actions are reusable modules that each course has access to. They are each designed to do very specific things, and nothing more. This is to optimize for reusability and simplicity.

Available actions

Adding a new action

Do you have a great idea for a new action that would be beneficial to course authors? Here's what you can do to help:

  1. Fork this repository.

  2. Clone this repository.

  3. Inside of the repository's directory, install dependencies by executing npm install from a terminal.

  4. Inside of the repository's directory, verify the tests initially pass on your machine by executing npm test from a terminal.

  5. Create a new branch from master.

  6. Decide on a camel-cased name for your new action, e.g. createIssue. Henceforth, we will refer to this value as ${actionName}.

  7. Inside of the repository's directory, generate a new action by executing npm run action:init from a terminal. When prompted for your action's name, provide it (${actionName}). This will add a new directory named ${actionName} to the actions/ directory. Inside of that new directory, you will find these specific files have been created:

    • schema.js
      • A Joi schema describing your action, its arguments, and example usage.
    • index.js
      • An async-compatible function to execute your action's desired behavior.
    • index.test.js
      • Jest-based unit tests for your action. It should contain a top-level describe suite with the name ${actionName}.
    • README.md
      • An initial README for your action.
      • ⚠️ You should specifically NOT edit this file as it will be automatically regenerated by a script in a later step!
  8. Update the contents of the aforementioned files to bring your action to life! Be sure to execute npm test as you work to verify your syntax and test results.

  9. When you think your action is ready, execute npm run doc to regenerate the action-specific actions/${actionName}/README.md. Review the content to ensure it is to your liking.

  10. Commit all of your changes to the branch.

  11. Push that branch to your remote repository.

  12. Create a new Pull Request in this repository.