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.
- assignRegistrant
- closeIssue
- createFile
- createIssue
- createLabel
- createProjectBoard
- createPullRequest
- createPullRequestComment
- createReview
- createStatus
- deleteBranch
- findInTree
- gate
- getFileContents
- getIssue
- getPullRequest
- getTree
- htmlContainsTag
- mergeBranch
- mergePullRequest
- octokit
- removeBranchProtection
- requestReviewFromRegistrant
- respond
- updateBranchProtection
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:
-
Fork this repository.
-
Clone this repository.
-
Inside of the repository's directory, install dependencies by executing
npm install
from a terminal. -
Inside of the repository's directory, verify the tests initially pass on your machine by executing
npm test
from a terminal. -
Create a new branch from
master
. -
Decide on a camel-cased name for your new action, e.g.
createIssue
. Henceforth, we will refer to this value as${actionName}
. -
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 theactions/
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.
- An
index.test.js
- Jest-based unit tests for your action.
It should contain a top-level
describe
suite with the name${actionName}
.
- Jest-based unit tests for your action.
It should contain a top-level
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!
-
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. -
When you think your action is ready, execute
npm run doc
to regenerate the action-specificactions/${actionName}/README.md
. Review the content to ensure it is to your liking. -
Commit all of your changes to the branch.
-
Push that branch to your remote repository.
-
Create a new Pull Request in this repository.