I would like to run Qodana on GitHub actions using the workflow file that is listed later on.
The project is based on Java and built using Gradle.
The Gradle build resolves dependencies from a private Maven repository and therefore I need to propagate the credentials to the Qodana action.
name: Qodana
on:
workflow_dispatch:
pull_request:
push:
branches:
- '[0-9]+.[0-9]+.x'
jobs:
qodana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Qodana Scan'
uses: JetBrains/[email protected]
with:
args: -e ORG_GRADLE_PROJECT_onstructiveUsername=${{ secrets.M2_USER }},-e ORG_GRADLE_PROJECT_onstructivePassword=${{ secrets.M2_PWD }}
I followed the Qodana scan documentation and tried to propagate the credentials as environment variables using the args
parameter.
args: -e ORG_GRADLE_PROJECT_onstructiveUsername=${{ secrets.M2_USER }},-e ORG_GRADLE_PROJECT_onstructivePassword=${{ secrets.M2_PWD }}
Unfortunately the GitHub action build fails with that error.
(Project configuration) STDERR: Build file '/data/project/build.***' line: 2
(Project configuration) STDERR:
(Project configuration) STDERR:
(Project configuration) STDERR: * What went wrong:
(Project configuration) STDERR:
(Project configuration) STDERR: Error resolving plugin [id: 'com.github.johnren
(Project configuration) STDERR:
(Project configuration) STDERR: >
(Project configuration) STDERR: The following Gradle properties are missing for
(Project configuration) STDERR:
(Project configuration) STDERR: - onstructiveUsername
(Project configuration) STDERR:
(Project configuration) STDERR: - onstructivePassword
It seems like the environment variables are not present for Qodana. Running the same thing locally on my machine using Qodana as a Docker container works fine.
docker run --rm -it -p 8080:8080 \
-v /src:/data/project/ \
-v /src/build/results:/data/results/ \
-e ORG_GRADLE_PROJECT_onstructiveUsername=user \
-e ORG_GRADLE_PROJECT_onstructivePassword=password \
jetbrains/qodana-jvm-community:2022.2 --show-report
Does anyone of you know how to solve this one?
I found the reason. The
args
parameter is comma separated.Therefore
needs to be changed to
This has been confirmed by another Twitter user.
Please make sure your “args” are divided by comma “,”, not spaces. Thank you! I’ll try to update the docs to make it more clear!— Viktor Tiulpin (@tiulpin) November 3, 2022