Skip to content

Commit

Permalink
Merge pull request #230 from boesing/bugfix/normalize-base-ref
Browse files Browse the repository at this point in the history
Properly parse `GITHUB_BASE_REF`
  • Loading branch information
boesing authored Jul 11, 2023
2 parents c741f71 + 7a0c9d2 commit a32891f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ export default function createConfig(

configurationFromFile.extensions?.forEach((extension) => phpExtensions = phpExtensions.add(extension));

let baseReference: string|null = (process.env.GITHUB_BASE_REF ?? '').replaceAll('"', '');

if (baseReference === '') {
baseReference = null;
}

return {
codeChecks : requirements.codeChecks,
docLinting : requirements.docLinting,
Expand All @@ -480,7 +486,7 @@ export default function createConfig(
ignorePhpPlatformRequirements : configurationFromFile.ignore_php_platform_requirements ?? {},
additionalComposerArguments : [ ... new Set(configurationFromFile.additional_composer_arguments ?? []) ],
backwardCompatibilityCheck : configurationFromFile.backwardCompatibilityCheck ?? false,
baseReference : process.env.GITHUB_BASE_REF ?? null,
baseReference : baseReference,
};
}

Expand Down
2 changes: 1 addition & 1 deletion tests/code-check-roave-backward-compatibility/test.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
GITHUB_BASE_REF=1111222233334444aaaabbbbccccdddd
GITHUB_BASE_REF="1111222233334444aaaabbbbccccdddd"

0 comments on commit a32891f

Please sign in to comment.