Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lombok: Don't set env var if it's already set #1844

Merged
merged 4 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th

## [UNRELEASED]

No user facing changes.
- Fixed a bug in CodeQL Action 2.21.3 onwards that affected beta support for [Project Lombok](https://projectlombok.org/) when analyzing Java. The environment variable `CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS` will now be respected if it was manually configured in the workflow. [#1844](https://github.com/github/codeql-action/pull/1844)

## 2.21.4 - 14 Aug 2023

Expand Down
10 changes: 7 additions & 3 deletions lib/init-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,19 @@ async function run() {
}

if (config.languages.includes(Language.java)) {
if (await features.getValue(Feature.CodeqlJavaLombokEnabled, codeql)) {
logger.info("Enabling CodeQL Java Lombok support");
core.exportVariable(
"CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS",
"true",
const envVar = "CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS";
if (process.env[envVar]) {
logger.info(
`Environment variable ${envVar} already set. Not en/disabling CodeQL Java Lombok support`,
);
} else if (
await features.getValue(Feature.CodeqlJavaLombokEnabled, codeql)
) {
logger.info("Enabling CodeQL Java Lombok support");
core.exportVariable(envVar, "true");
} else {
logger.info("Disabling CodeQL Java Lombok support");
core.exportVariable(
"CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS",
"false",
);
core.exportVariable(envVar, "false");
}
}

Expand Down
Loading