Development template from https://github.com/actions/typescript-action.
After you've cloned the repository to your local machine or codespace, you'll need to perform some initial setup steps before you can develop your action.
Note
You'll need to have a reasonably modern version of
Node.js handy (24.x or later should work!). If you are
using a version manager like nodenv or
nvm, this template has a .node-version
file at the root of the repository that will be used to automatically switch
to the correct version when you cd into the repository. Additionally, this
.node-version file is used by GitHub Actions in any actions/setup-node
actions.
-
π οΈ Install the dependencies
bun install
-
ποΈ Package the TypeScript for distribution
bun run bundle
-
β Run the tests
$ bun run test PASS ./index.test.js index β calls run when imported (3 ms) PASS __tests__/main.test.ts action β invalid api host (2 ms) β invalid database input (1 ms) β valid inputs (11 ms) PASS __tests__/diff.test.ts diff β should throw an error if the project does not exist (9 ms) β should throw an error if the branch is not found (1 ms) β should throw an error if the branch has no parent β works with valid project and branch (2 ms) ...
-
β Run the action locally with
local-action$ cp .env.example .env # modify your environment variables $ bun run local-actionCurrently, the action skips the create comment part, in the future we can have a specific repository to test this flow entirely in the CI.