Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
depau committed Jul 12, 2024
1 parent 5200f75 commit 97f6a6a
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,51 @@ version: 1
linter: ghcr.io/expandigroup/qodana-jvm:latest
```

# Usage in monorepos

In a monorepo, place the `qodana.yml` file in the project directory, and specify the hacked linter in the GitHub Actions
workflow.

You can specify `-e SUBPROJECT_DIR=path/to/project` to specify a project to be scanned. It will be scanned while keeping
still mounting the entire repository.
still mounting the entire repository.

For instance:

```bash
qodana scan \
-l ghcr.io/expandigroup/qodana-jvm:2024.1 \
-i . \
-e SUBPROJECT_DIR=backend \
-e QODANA_TOKEN="$QODANA_TOKEN"
```

Sample GitHub Actions workflow:

```yml
name: Qodana
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
qodana:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis
- name: 'Qodana Scan'
uses: JetBrains/[email protected]
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
with:
args: -l,ghcr.io/expandigroup/qodana-jvm:2024.1,-e,SUBPROJECT_DIR=backend
```

0 comments on commit 97f6a6a

Please sign in to comment.