mirror of
https://github.com/gradle/actions.git
synced 2026-03-24 04:55:48 +08:00
Inject Develocity plugin for versions 3.17 and above (#62)
To handle the rebranding of the GE plugin, this PR updates the inject-develocity init script to apply the `com.gradle.develocity` plugin if `3.17+` version of the plugin is requested.
This commit is contained in:
@@ -1,26 +1,25 @@
|
||||
import * as core from '@actions/core'
|
||||
import {
|
||||
getBuildScanPublishEnabled,
|
||||
getBuildScanTermsOfServiceUrl,
|
||||
getBuildScanTermsOfServiceAgree
|
||||
} from './input-params'
|
||||
import {getBuildScanPublishEnabled, getBuildScanTermsOfUseUrl, getBuildScanTermsOfUseAgree} from './input-params'
|
||||
|
||||
export function setup(): void {
|
||||
if (getBuildScanPublishEnabled() && verifyTermsOfServiceAgreement()) {
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_INIT_SCRIPT_NAME', 'gradle-actions.inject-develocity.init.gradle')
|
||||
maybeExportVariable('DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE', 'gradle-actions')
|
||||
if (getBuildScanPublishEnabled() && verifyTermsOfUseAgreement()) {
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
|
||||
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.16.2')
|
||||
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '1.13')
|
||||
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_URL', getBuildScanTermsOfServiceUrl())
|
||||
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_AGREE', getBuildScanTermsOfServiceAgree())
|
||||
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', getBuildScanTermsOfUseUrl())
|
||||
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', getBuildScanTermsOfUseAgree())
|
||||
}
|
||||
}
|
||||
|
||||
function verifyTermsOfServiceAgreement(): boolean {
|
||||
function verifyTermsOfUseAgreement(): boolean {
|
||||
if (
|
||||
getBuildScanTermsOfServiceUrl() !== 'https://gradle.com/terms-of-service' ||
|
||||
getBuildScanTermsOfServiceAgree() !== 'yes'
|
||||
(getBuildScanTermsOfUseUrl() !== 'https://gradle.com/terms-of-service' &&
|
||||
getBuildScanTermsOfUseUrl() !== 'https://gradle.com/help/legal-terms-of-use') ||
|
||||
getBuildScanTermsOfUseAgree() !== 'yes'
|
||||
) {
|
||||
core.warning(`Terms of service must be agreed in order to publish build scans.`)
|
||||
core.warning(`Terms of use must be agreed in order to publish build scans.`)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user