GitHub action to comment depcruise report to a pull request, also provides an optional status check for the job.
on: pull_request
jobs:
example_depcruise_pr:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
name: An example job to comment depcruise report to a PR
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Depcruise
uses: josteph/depcruise-pull-request@v1.0.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}You can explicitly input which pull request should be commented on by passing the pr_number input.
That is particularly useful for manual workflow for instance (workflow_run).
...
- name: Depcruise
uses: josteph/depcruise-pull-request@v1.0.0
with:
pr_number: 100 # This will comment on pull request #100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}You can also override the baseDir and depcruise config file path. The path must be relative to root directory.
...
- name: Depcruise
uses: josteph/depcruise-pull-request@v1.0.0
with:
depcruise_base_dir: 'packages/monorepo-a'
depcruise_config: 'packages/monorepo-a/.dependency-cruiser.js'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Minimum permissions for this GitHub action to work correctly:
permissions:
contents: read
pull-requests: write
checks: writeThe build steps bundles the src/main.ts to lib/index.js which is used in a NodeJS environment.
It is handled by esbuild compiler.
$ npm run build