Use "Terms of Use" terminology instead of "Terms of Service"

This commit is contained in:
Pavlo Shevchenko 2024-03-06 22:11:23 +01:00 committed by daz
parent 27a6649606
commit 0c53023692
No known key found for this signature in database
8 changed files with 58 additions and 47 deletions

View File

@ -83,8 +83,8 @@ jobs:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: ${{ matrix.gradle }}
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-service-agree: "yes"
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Run Gradle build
id: gradle
working-directory: .github/workflow-samples/no-ge

View File

@ -97,15 +97,15 @@ offending dependency.
### Publishing a Develocity Build Scan® from your dependency submission workflow
You can automatically publish a Build Scan on every run of `gradle/actions/dependency-submission`. Three input parameters are
required, one to enable publishing and two more to accept the [Develocity terms of service](https://gradle.com/terms-of-service).
required, one to enable publishing and two more to accept the [Develocity terms of use](https://gradle.com/terms-of-service).
```yaml
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
with:
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-service-agree: "yes"
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
```
### When you cannot publish a Build Scan®

View File

@ -37,14 +37,14 @@ inputs:
build-scan-publish:
description: |
Set to 'true' to automatically publish build results as a Build Scan on scans.gradle.com.
For publication to succeed without user input, you must also provide values for `build-scan-terms-of-service-url` and 'build-scan-terms-of-service-agree'.
For publication to succeed without user input, you must also provide values for `build-scan-terms-of-use-url` and 'build-scan-terms-of-use-agree'.
required: false
default: false
build-scan-terms-of-service-url:
description: The URL to the Build Scan® terms of service. This input must be set to 'https://gradle.com/terms-of-service'.
build-scan-terms-of-use-url:
description: The URL to the Build Scan® terms of use. This input must be set to 'https://gradle.com/terms-of-service'.
required: false
build-scan-terms-of-service-agree:
description: Indicate that you agree to the Build Scan® terms of service. This input value must be "yes".
build-scan-terms-of-use-agree:
description: Indicate that you agree to the Build Scan® terms of use. This input value must be "yes".
required: false
runs:
@ -67,8 +67,8 @@ runs:
build-root-directory: ${{ inputs.build-root-directory }}
cache-encryption-key: ${{ inputs.cache-encryption-key }}
build-scan-publish: ${{ inputs.build-scan-publish }}
build-scan-terms-of-service-url: ${{ inputs.build-scan-terms-of-service-url }}
build-scan-terms-of-service-agree: ${{ inputs.build-scan-terms-of-service-agree }}
build-scan-terms-of-use-url: ${{ inputs.build-scan-terms-of-use-url }}
build-scan-terms-of-use-agree: ${{ inputs.build-scan-terms-of-use-agree }}
artifact-retention-days: 1
arguments: |
-Dorg.gradle.configureondemand=false

View File

@ -688,7 +688,7 @@ The `init-script` supports several additional configuration parameters that you
Develocity injection is designed to enable the publishing of build scans to a Develocity instance,
but is also useful for publishing to the public Build Scans instance (https://scans.gradle.com).
To publish to https://scans.gradle.com, you must specify in your workflow that you accept the [Gradle Terms of Service](https://gradle.com/terms-of-service).
To publish to https://scans.gradle.com, you must specify in your workflow that you accept the [Gradle Terms of Use](https://gradle.com/terms-of-service).
```yaml
name: Run build and publish Build Scan
@ -702,8 +702,8 @@ jobs:
uses: gradle/actions/setup-gradle@v3
with:
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-service-agree: "yes"
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Run a Gradle build - a build scan will be published automatically
run: ./gradlew build

View File

@ -85,16 +85,16 @@ inputs:
build-scan-publish:
description: |
Set to 'true' to automatically publish build results as a Build Scan on scans.gradle.com.
For publication to succeed without user input, you must also provide values for `build-scan-terms-of-service-url` and 'build-scan-terms-of-service-agree'.
For publication to succeed without user input, you must also provide values for `build-scan-terms-of-use-url` and 'build-scan-terms-of-use-agree'.
required: false
default: false
build-scan-terms-of-service-url:
description: The URL to the Build Scan® terms of service. This input must be set to 'https://gradle.com/terms-of-service'.
build-scan-terms-of-use-url:
description: The URL to the Build Scan® terms of use. This input must be set to 'https://gradle.com/terms-of-service'.
required: false
build-scan-terms-of-service-agree:
description: Indicate that you agree to the Build Scan® terms of service. This input value must be "yes".
build-scan-terms-of-use-agree:
description: Indicate that you agree to the Build Scan® terms of use. This input value must be "yes".
required: false
# DEPRECATED ACTION INPUTS

View File

@ -1,8 +1,8 @@
import * as core from '@actions/core'
import {
getBuildScanPublishEnabled,
getBuildScanTermsOfServiceUrl,
getBuildScanTermsOfServiceAgree
getBuildScanTermsOfUseUrl,
getBuildScanTermsOfUseAgree
} from './input-params'
export function setup(): void {
@ -10,17 +10,17 @@ export function setup(): void {
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('BUILD_SCAN_TERMS_OF_SERVICE_URL', getBuildScanTermsOfUseUrl())
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_AGREE', getBuildScanTermsOfUseAgree())
}
}
function verifyTermsOfServiceAgreement(): boolean {
if (
getBuildScanTermsOfServiceUrl() !== 'https://gradle.com/terms-of-service' ||
getBuildScanTermsOfServiceAgree() !== 'yes'
getBuildScanTermsOfUseUrl() !== 'https://gradle.com/terms-of-service' ||
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

View File

@ -79,12 +79,20 @@ export function getBuildScanPublishEnabled(): boolean {
return getBooleanInput('build-scan-publish')
}
export function getBuildScanTermsOfServiceUrl(): string {
return core.getInput('build-scan-terms-of-service-url')
export function getBuildScanTermsOfUseUrl(): string {
return getTermsOfUseProp('build-scan-terms-of-use-url', 'build-scan-terms-of-service-url')
}
export function getBuildScanTermsOfServiceAgree(): string {
return core.getInput('build-scan-terms-of-service-agree')
export function getBuildScanTermsOfUseAgree(): string {
return getTermsOfUseProp('build-scan-terms-of-use-agree', 'build-scan-terms-of-service-agree')
}
function getTermsOfUseProp(newPropName: string, oldPropName: string): string {
const newProp = core.getInput(newPropName)
if (newProp.length !== 0) {
return newProp
}
return core.getInput(oldPropName)
}
function parseJobSummaryOption(paramName: string): JobSummaryOption {

View File

@ -72,10 +72,9 @@ def GRADLE_ENTERPRISE_PLUGIN_CLASS = 'com.gradle.enterprise.gradleplugin.GradleE
def DEVELOCITY_PLUGIN_ID = 'com.gradle.develocity'
def DEVELOCITY_PLUGIN_CLASS = 'com.gradle.develocity.agent.gradle.DevelocityPlugin'
def SETTINGS_EXTENSION_CLASSES = [
'com.gradle.enterprise.gradleplugin.GradleEnterpriseExtension',
'com.gradle.develocity.agent.gradle.DevelocityConfiguration'
]
def GRADLE_ENTERPRISE_EXTENSION_CLASS = 'com.gradle.enterprise.gradleplugin.GradleEnterpriseExtension'
def DEVELOCITY_CONFIGURATION_CLASS = 'com.gradle.develocity.agent.gradle.DevelocityConfiguration'
def SETTINGS_EXTENSION_CLASSES = [GRADLE_ENTERPRISE_EXTENSION_CLASS, DEVELOCITY_CONFIGURATION_CLASS]
def CI_AUTO_INJECTION_CUSTOM_VALUE_NAME = 'CI auto injection'
def CI_AUTO_INJECTION_CUSTOM_VALUE_VALUE = 'gradle-actions'
@ -105,8 +104,8 @@ def buildScanUploadInBackground = Boolean.parseBoolean(getInputParam('develocity
def develocityCaptureFileFingerprints = getInputParam('develocity.capture-file-fingerprints') ? Boolean.parseBoolean(getInputParam('develocity.capture-file-fingerprints')) : true
def develocityPluginVersion = getInputParam('develocity.plugin.version')
def ccudPluginVersion = getInputParam('develocity.ccud-plugin.version')
def buildScanTermsOfServiceUrl = getInputParam('build-scan.terms-of-service.url')
def buildScanTermsOfServiceAgree = getInputParam('build-scan.terms-of-service.agree')
def buildScanTermsOfUseUrl = getInputParam('build-scan.terms-of-use.url') ?: getInputParam('build-scan.terms-of-service.url')
def buildScanTermsOfUseAgree = getInputParam('build-scan.terms-of-use.agree') ?: getInputParam('build-scan.terms-of-service.agree')
def atLeastGradle5 = GradleVersion.current() >= GradleVersion.version('5.0')
def atLeastGradle4 = GradleVersion.current() >= GradleVersion.version('4.0')
@ -177,9 +176,9 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
buildScan.allowUntrustedServer = develocityAllowUntrustedServer
}
if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) {
buildScan.termsOfServiceUrl = buildScanTermsOfServiceUrl
buildScan.termsOfServiceAgree = buildScanTermsOfServiceAgree
if (buildScanTermsOfUseUrl && buildScanTermsOfUseAgree) {
buildScan.termsOfServiceUrl = buildScanTermsOfUseUrl
buildScan.termsOfServiceAgree = buildScanTermsOfUseAgree
}
}
}
@ -191,9 +190,9 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
develocity.allowUntrustedServer = develocityAllowUntrustedServer
}
if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) {
develocity.buildScan.termsOfServiceUrl = buildScanTermsOfServiceUrl
develocity.buildScan.termsOfServiceAgree = buildScanTermsOfServiceAgree
if (buildScanTermsOfUseUrl && buildScanTermsOfUseAgree) {
develocity.buildScan.termsOfUseUrl = buildScanTermsOfUseUrl
develocity.buildScan.termsOfUseAgree = buildScanTermsOfUseAgree
}
}
}
@ -251,10 +250,14 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
}
}
if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) {
eachDevelocitySettingsExtension(settings, SETTINGS_EXTENSION_CLASSES) { ext ->
ext.buildScan.termsOfServiceUrl = buildScanTermsOfServiceUrl
ext.buildScan.termsOfServiceAgree = buildScanTermsOfServiceAgree
if (buildScanTermsOfUseUrl && buildScanTermsOfUseAgree) {
eachDevelocitySettingsExtension(settings, [GRADLE_ENTERPRISE_EXTENSION_CLASS]) { ext ->
ext.buildScan.termsOfServiceUrl = buildScanTermsOfUseUrl
ext.buildScan.termsOfServiceAgree = buildScanTermsOfUseAgree
}
eachDevelocitySettingsExtension(settings, [DEVELOCITY_CONFIGURATION_CLASS]) { ext ->
ext.buildScan.termsOfUseUrl = buildScanTermsOfUseUrl
ext.buildScan.termsOfUseAgree = buildScanTermsOfUseAgree
}
}
}