This action is meant to work with pronto-annotations-formatter. No need to use GitHub oauth token.
Learn more about pronto at https://github.com/prontolabs/pronto.
To include the action in a workflow in another repository, you can use the
uses
syntax with the @
symbol to reference a specific branch, tag, or commit
hash.
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v3
- name: Test Local Action
id: test-action
uses: emilio2hd/pronto-annotate-action@0.1.0
with:
reportPath: annotations.json
Note, you can also point to the main
branch with uses: emilio2hd/pronto-annotate-action@main
Please, check this annotations.json, to see the expected json content.
Once you run the step, you should see the annotations on the following places:
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. If you are using a version manager like
nodenv
or
nvm
, you can run nodenv install
in the
root of your repository to install the version specified in
package.json
. Otherwise, 20.x or later should work!
-
🛠️ Install the dependencies
npm install
-
🏗️ Package the TypeScript for distribution
npm run bundle
-
✅ Run the tests
$ npm test PASS ./index.test.js ✓ throws invalid number (3ms) ✓ wait 500 ms (504ms) ✓ test runs (95ms) ...
There are a few things to keep in mind when writing your action code:
-
Most GitHub Actions toolkit and CI/CD operations are processed asynchronously. In
main.ts
, you will see that the action is run in anasync
function.import * as core from '@actions/core' //... async function run() { try { //... } catch (error) { core.setFailed(error.message) } }
For more information about the GitHub Actions toolkit, see the documentation.