mirror of
https://github.com/gradle/actions.git
synced 2025-04-23 03:09:20 +08:00
Use "Terms of Use" terminology instead of "Terms of Service"
This commit is contained in:
parent
27a6649606
commit
0c53023692
@ -83,8 +83,8 @@ jobs:
|
|||||||
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||||
gradle-version: ${{ matrix.gradle }}
|
gradle-version: ${{ matrix.gradle }}
|
||||||
build-scan-publish: true
|
build-scan-publish: true
|
||||||
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
|
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
|
||||||
build-scan-terms-of-service-agree: "yes"
|
build-scan-terms-of-use-agree: "yes"
|
||||||
- name: Run Gradle build
|
- name: Run Gradle build
|
||||||
id: gradle
|
id: gradle
|
||||||
working-directory: .github/workflow-samples/no-ge
|
working-directory: .github/workflow-samples/no-ge
|
||||||
|
@ -97,15 +97,15 @@ offending dependency.
|
|||||||
### Publishing a Develocity Build Scan® from your dependency submission workflow
|
### 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
|
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
|
```yaml
|
||||||
- name: Generate and submit dependency graph
|
- name: Generate and submit dependency graph
|
||||||
uses: gradle/actions/dependency-submission@v3
|
uses: gradle/actions/dependency-submission@v3
|
||||||
with:
|
with:
|
||||||
build-scan-publish: true
|
build-scan-publish: true
|
||||||
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
|
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
|
||||||
build-scan-terms-of-service-agree: "yes"
|
build-scan-terms-of-use-agree: "yes"
|
||||||
```
|
```
|
||||||
|
|
||||||
### When you cannot publish a Build Scan®
|
### When you cannot publish a Build Scan®
|
||||||
|
@ -37,14 +37,14 @@ inputs:
|
|||||||
build-scan-publish:
|
build-scan-publish:
|
||||||
description: |
|
description: |
|
||||||
Set to 'true' to automatically publish build results as a Build Scan on scans.gradle.com.
|
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
|
required: false
|
||||||
default: false
|
default: false
|
||||||
build-scan-terms-of-service-url:
|
build-scan-terms-of-use-url:
|
||||||
description: The URL to the Build Scan® terms of service. This input must be set to 'https://gradle.com/terms-of-service'.
|
description: The URL to the Build Scan® terms of use. This input must be set to 'https://gradle.com/terms-of-service'.
|
||||||
required: false
|
required: false
|
||||||
build-scan-terms-of-service-agree:
|
build-scan-terms-of-use-agree:
|
||||||
description: Indicate that you agree to the Build Scan® terms of service. This input value must be "yes".
|
description: Indicate that you agree to the Build Scan® terms of use. This input value must be "yes".
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
@ -67,8 +67,8 @@ runs:
|
|||||||
build-root-directory: ${{ inputs.build-root-directory }}
|
build-root-directory: ${{ inputs.build-root-directory }}
|
||||||
cache-encryption-key: ${{ inputs.cache-encryption-key }}
|
cache-encryption-key: ${{ inputs.cache-encryption-key }}
|
||||||
build-scan-publish: ${{ inputs.build-scan-publish }}
|
build-scan-publish: ${{ inputs.build-scan-publish }}
|
||||||
build-scan-terms-of-service-url: ${{ inputs.build-scan-terms-of-service-url }}
|
build-scan-terms-of-use-url: ${{ inputs.build-scan-terms-of-use-url }}
|
||||||
build-scan-terms-of-service-agree: ${{ inputs.build-scan-terms-of-service-agree }}
|
build-scan-terms-of-use-agree: ${{ inputs.build-scan-terms-of-use-agree }}
|
||||||
artifact-retention-days: 1
|
artifact-retention-days: 1
|
||||||
arguments: |
|
arguments: |
|
||||||
-Dorg.gradle.configureondemand=false
|
-Dorg.gradle.configureondemand=false
|
||||||
|
@ -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,
|
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).
|
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
|
```yaml
|
||||||
name: Run build and publish Build Scan
|
name: Run build and publish Build Scan
|
||||||
@ -702,8 +702,8 @@ jobs:
|
|||||||
uses: gradle/actions/setup-gradle@v3
|
uses: gradle/actions/setup-gradle@v3
|
||||||
with:
|
with:
|
||||||
build-scan-publish: true
|
build-scan-publish: true
|
||||||
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
|
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
|
||||||
build-scan-terms-of-service-agree: "yes"
|
build-scan-terms-of-use-agree: "yes"
|
||||||
|
|
||||||
- name: Run a Gradle build - a build scan will be published automatically
|
- name: Run a Gradle build - a build scan will be published automatically
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
|
@ -85,16 +85,16 @@ inputs:
|
|||||||
build-scan-publish:
|
build-scan-publish:
|
||||||
description: |
|
description: |
|
||||||
Set to 'true' to automatically publish build results as a Build Scan on scans.gradle.com.
|
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
|
required: false
|
||||||
default: false
|
default: false
|
||||||
|
|
||||||
build-scan-terms-of-service-url:
|
build-scan-terms-of-use-url:
|
||||||
description: The URL to the Build Scan® terms of service. This input must be set to 'https://gradle.com/terms-of-service'.
|
description: The URL to the Build Scan® terms of use. This input must be set to 'https://gradle.com/terms-of-service'.
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
build-scan-terms-of-service-agree:
|
build-scan-terms-of-use-agree:
|
||||||
description: Indicate that you agree to the Build Scan® terms of service. This input value must be "yes".
|
description: Indicate that you agree to the Build Scan® terms of use. This input value must be "yes".
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
# DEPRECATED ACTION INPUTS
|
# DEPRECATED ACTION INPUTS
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {
|
import {
|
||||||
getBuildScanPublishEnabled,
|
getBuildScanPublishEnabled,
|
||||||
getBuildScanTermsOfServiceUrl,
|
getBuildScanTermsOfUseUrl,
|
||||||
getBuildScanTermsOfServiceAgree
|
getBuildScanTermsOfUseAgree
|
||||||
} from './input-params'
|
} from './input-params'
|
||||||
|
|
||||||
export function setup(): void {
|
export function setup(): void {
|
||||||
@ -10,17 +10,17 @@ export function setup(): void {
|
|||||||
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
|
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
|
||||||
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.16.2')
|
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.16.2')
|
||||||
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '1.13')
|
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '1.13')
|
||||||
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_URL', getBuildScanTermsOfServiceUrl())
|
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_URL', getBuildScanTermsOfUseUrl())
|
||||||
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_AGREE', getBuildScanTermsOfServiceAgree())
|
maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_AGREE', getBuildScanTermsOfUseAgree())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function verifyTermsOfServiceAgreement(): boolean {
|
function verifyTermsOfServiceAgreement(): boolean {
|
||||||
if (
|
if (
|
||||||
getBuildScanTermsOfServiceUrl() !== 'https://gradle.com/terms-of-service' ||
|
getBuildScanTermsOfUseUrl() !== 'https://gradle.com/terms-of-service' ||
|
||||||
getBuildScanTermsOfServiceAgree() !== 'yes'
|
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 false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
@ -79,12 +79,20 @@ export function getBuildScanPublishEnabled(): boolean {
|
|||||||
return getBooleanInput('build-scan-publish')
|
return getBooleanInput('build-scan-publish')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBuildScanTermsOfServiceUrl(): string {
|
export function getBuildScanTermsOfUseUrl(): string {
|
||||||
return core.getInput('build-scan-terms-of-service-url')
|
return getTermsOfUseProp('build-scan-terms-of-use-url', 'build-scan-terms-of-service-url')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBuildScanTermsOfServiceAgree(): string {
|
export function getBuildScanTermsOfUseAgree(): string {
|
||||||
return core.getInput('build-scan-terms-of-service-agree')
|
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 {
|
function parseJobSummaryOption(paramName: string): JobSummaryOption {
|
||||||
|
@ -72,10 +72,9 @@ def GRADLE_ENTERPRISE_PLUGIN_CLASS = 'com.gradle.enterprise.gradleplugin.GradleE
|
|||||||
|
|
||||||
def DEVELOCITY_PLUGIN_ID = 'com.gradle.develocity'
|
def DEVELOCITY_PLUGIN_ID = 'com.gradle.develocity'
|
||||||
def DEVELOCITY_PLUGIN_CLASS = 'com.gradle.develocity.agent.gradle.DevelocityPlugin'
|
def DEVELOCITY_PLUGIN_CLASS = 'com.gradle.develocity.agent.gradle.DevelocityPlugin'
|
||||||
def SETTINGS_EXTENSION_CLASSES = [
|
def GRADLE_ENTERPRISE_EXTENSION_CLASS = 'com.gradle.enterprise.gradleplugin.GradleEnterpriseExtension'
|
||||||
'com.gradle.enterprise.gradleplugin.GradleEnterpriseExtension',
|
def DEVELOCITY_CONFIGURATION_CLASS = 'com.gradle.develocity.agent.gradle.DevelocityConfiguration'
|
||||||
'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_NAME = 'CI auto injection'
|
||||||
def CI_AUTO_INJECTION_CUSTOM_VALUE_VALUE = 'gradle-actions'
|
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 develocityCaptureFileFingerprints = getInputParam('develocity.capture-file-fingerprints') ? Boolean.parseBoolean(getInputParam('develocity.capture-file-fingerprints')) : true
|
||||||
def develocityPluginVersion = getInputParam('develocity.plugin.version')
|
def develocityPluginVersion = getInputParam('develocity.plugin.version')
|
||||||
def ccudPluginVersion = getInputParam('develocity.ccud-plugin.version')
|
def ccudPluginVersion = getInputParam('develocity.ccud-plugin.version')
|
||||||
def buildScanTermsOfServiceUrl = getInputParam('build-scan.terms-of-service.url')
|
def buildScanTermsOfUseUrl = getInputParam('build-scan.terms-of-use.url') ?: getInputParam('build-scan.terms-of-service.url')
|
||||||
def buildScanTermsOfServiceAgree = getInputParam('build-scan.terms-of-service.agree')
|
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 atLeastGradle5 = GradleVersion.current() >= GradleVersion.version('5.0')
|
||||||
def atLeastGradle4 = GradleVersion.current() >= GradleVersion.version('4.0')
|
def atLeastGradle4 = GradleVersion.current() >= GradleVersion.version('4.0')
|
||||||
@ -177,9 +176,9 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
|
|||||||
buildScan.allowUntrustedServer = develocityAllowUntrustedServer
|
buildScan.allowUntrustedServer = develocityAllowUntrustedServer
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) {
|
if (buildScanTermsOfUseUrl && buildScanTermsOfUseAgree) {
|
||||||
buildScan.termsOfServiceUrl = buildScanTermsOfServiceUrl
|
buildScan.termsOfServiceUrl = buildScanTermsOfUseUrl
|
||||||
buildScan.termsOfServiceAgree = buildScanTermsOfServiceAgree
|
buildScan.termsOfServiceAgree = buildScanTermsOfUseAgree
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,9 +190,9 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
|
|||||||
develocity.allowUntrustedServer = develocityAllowUntrustedServer
|
develocity.allowUntrustedServer = develocityAllowUntrustedServer
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) {
|
if (buildScanTermsOfUseUrl && buildScanTermsOfUseAgree) {
|
||||||
develocity.buildScan.termsOfServiceUrl = buildScanTermsOfServiceUrl
|
develocity.buildScan.termsOfUseUrl = buildScanTermsOfUseUrl
|
||||||
develocity.buildScan.termsOfServiceAgree = buildScanTermsOfServiceAgree
|
develocity.buildScan.termsOfUseAgree = buildScanTermsOfUseAgree
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -251,10 +250,14 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) {
|
if (buildScanTermsOfUseUrl && buildScanTermsOfUseAgree) {
|
||||||
eachDevelocitySettingsExtension(settings, SETTINGS_EXTENSION_CLASSES) { ext ->
|
eachDevelocitySettingsExtension(settings, [GRADLE_ENTERPRISE_EXTENSION_CLASS]) { ext ->
|
||||||
ext.buildScan.termsOfServiceUrl = buildScanTermsOfServiceUrl
|
ext.buildScan.termsOfServiceUrl = buildScanTermsOfUseUrl
|
||||||
ext.buildScan.termsOfServiceAgree = buildScanTermsOfServiceAgree
|
ext.buildScan.termsOfServiceAgree = buildScanTermsOfUseAgree
|
||||||
|
}
|
||||||
|
eachDevelocitySettingsExtension(settings, [DEVELOCITY_CONFIGURATION_CLASS]) { ext ->
|
||||||
|
ext.buildScan.termsOfUseUrl = buildScanTermsOfUseUrl
|
||||||
|
ext.buildScan.termsOfUseAgree = buildScanTermsOfUseAgree
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user