Skip to content

Commit e426271

Browse files
authored
Merge pull request #1844 from github/igfoo/lombok_no_overwrite
Lombok: Don't set env var if it's already set
2 parents e683046 + ddf2bd2 commit e426271

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
44

55
## [UNRELEASED]
66

7-
No user facing changes.
7+
- 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)
88

99
## 2.21.4 - 14 Aug 2023
1010

lib/init-action.js

+7-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/init-action.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -347,18 +347,19 @@ async function run() {
347347
}
348348

349349
if (config.languages.includes(Language.java)) {
350-
if (await features.getValue(Feature.CodeqlJavaLombokEnabled, codeql)) {
351-
logger.info("Enabling CodeQL Java Lombok support");
352-
core.exportVariable(
353-
"CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS",
354-
"true",
350+
const envVar = "CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS";
351+
if (process.env[envVar]) {
352+
logger.info(
353+
`Environment variable ${envVar} already set. Not en/disabling CodeQL Java Lombok support`,
355354
);
355+
} else if (
356+
await features.getValue(Feature.CodeqlJavaLombokEnabled, codeql)
357+
) {
358+
logger.info("Enabling CodeQL Java Lombok support");
359+
core.exportVariable(envVar, "true");
356360
} else {
357361
logger.info("Disabling CodeQL Java Lombok support");
358-
core.exportVariable(
359-
"CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS",
360-
"false",
361-
);
362+
core.exportVariable(envVar, "false");
362363
}
363364
}
364365

0 commit comments

Comments
 (0)