generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it easy to publish to scans.gradle.com
- Allow init-script to publish to scans.gradle.com - Add paramaters to enable build scan publishing - Test coverage for build scan publishing
- Loading branch information
Showing
6 changed files
with
123 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as core from '@actions/core' | ||
import { | ||
getBuildScanPublishEnabled, | ||
getBuildScanTermsOfServiceUrl, | ||
getBuildScanTermsOfServiceAgree | ||
} from './input-params' | ||
|
||
export function setup(): void { | ||
if (getBuildScanPublishEnabled() && verifyTermsOfServiceAgreement()) { | ||
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true') | ||
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.16.1') | ||
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '1.12.1') | ||
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_URL', getBuildScanTermsOfServiceUrl()) | ||
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_AGREE', getBuildScanTermsOfServiceAgree()) | ||
} | ||
} | ||
|
||
function verifyTermsOfServiceAgreement(): boolean { | ||
if ( | ||
getBuildScanTermsOfServiceUrl() !== 'https://gradle.com/terms-of-service' || | ||
getBuildScanTermsOfServiceAgree() !== 'yes' | ||
) { | ||
core.warning(`Terms of service must be agreed in order to publish build scans.`) | ||
return false | ||
} | ||
return true | ||
} | ||
|
||
function maybeExportVariable(variableName: string, value: unknown): void { | ||
if (!process.env[variableName]) { | ||
core.exportVariable(variableName, value) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters