Links
Comment on page

First time setup

Pre-requisites
  • A GitHub repository for your project
  • A package.json file
  • A workflow file in .github/workflows directory
Below is an example of the minimal directory structure required:
.
├── package.json
└── .github
└── workflows/lstn.yml
In case your package.json file is not present in the root of the GitHub repo, adjust the path in the workdir field of the YAML workflow file.

Step 1: Create a new GitHub workflow

Click on the 'Actions' tab on top of your GitHub repo home page, and select "set up a workflow yourself->'
This should open a web-based editor where you can create a workflow file. This will automatically create the directory structure required to run the workflow.

Step 2: Create the workflow file

In the editor, use the file name lstn.yml and copy the workflow template below. Then commit changes.
Workflow file template:
name: lstn CI
on:
pull_request:
jobs:
lstn:
name: listen.dev dependency scan
runs-on: ubuntu-latest
steps:
- name: Clone the project repo
uses: actions/checkout@v3
- name: Run lstn scan
uses: listendev/[email protected]
Your workflow file should look similar to this:
View configuration options for details on customization.
On each pull request and subsequent commit, lstn will run and add comments to the PR with verdicts.
The comment will only be added once per commit, showing the most recent one.

Step 3: Create rules.yml file (optional)

Create a file called rules.yml in the root of the GitHub repo, and copy contents from this template file. This is only required for policy enforcement.
Last modified 4mo ago
© 2023 Garnet Labs