Skip to content

Commit 9ad4d4f

Browse files
authored
Add custom value when Develocity auto-injection is on (#150)
1 parent 98045d1 commit 9ad4d4f

6 files changed

Lines changed: 6 additions & 10 deletions

File tree

dist/setup-maven/main/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39659,7 +39659,7 @@ async function constructDevelocityMavenOpts(downloadFolder) {
3965939659
const credentials = username && password ? { username, password } : undefined;
3966039660
if (input.getDevelocityMavenExtensionVersion()) {
3966139661
const develocityMavenExtensionJar = await io.downloadFile(`${repository}com/gradle/develocity-maven-extension/${input.getDevelocityMavenExtensionVersion()}/develocity-maven-extension-${input.getDevelocityMavenExtensionVersion()}.jar`, downloadFolder, credentials);
39662-
develocityMavenExtensionMavenOpts = `${io.getDelimiter()}${develocityMavenExtensionJar} -Dgradle.enterprise.url=${input.getDevelocityUrl()} -Ddevelocity.url=${input.getDevelocityUrl()}`;
39662+
develocityMavenExtensionMavenOpts = `${io.getDelimiter()}${develocityMavenExtensionJar} -Dgradle.enterprise.url=${input.getDevelocityUrl()} -Ddevelocity.url=${input.getDevelocityUrl()} -Dscan.value.CIAutoInjection=GitHub`;
3966339663
if (input.getDevelocityAllowUntrustedServer()) {
3966439664
develocityMavenExtensionMavenOpts = `${develocityMavenExtensionMavenOpts} -Ddevelocity.allowUntrustedServer=${input.getDevelocityAllowUntrustedServer()}`;
3966539665
}

dist/setup-npm/main/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39618,6 +39618,7 @@ function configureEnvironment(wrappersDir) {
3961839618
if (allowUntrustedServer) {
3961939619
core.exportVariable('DEVELOCITY_ALLOW_UNTRUSTED_SERVER', allowUntrustedServer);
3962039620
}
39621+
core.exportVariable('DEVELOCITY_VALUE_CIAutoInjection', 'GitHub');
3962139622
}
3962239623
async function findAndVerifyBinary(binaryName) {
3962339624
// Find the actual npm binary

package-lock.json

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup-maven/__tests__/injection.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ describe('Injection', () => {
6262
// then
6363
expect(result).toContain('-Dgradle.enterprise.url=http://example.com')
6464
expect(result).toContain('-Ddevelocity.url=http://example.com')
65+
expect(result).not.toContain('-Dscan.value.CIAutoInjection=GitHub')
6566
})
6667

6768
it('injects Develocity Maven extension', async () => {
@@ -103,6 +104,7 @@ describe('Injection', () => {
103104
expect(result).toContain(':develocity-maven-extension-42.0.jar')
104105
expect(result).toContain('-Dgradle.enterprise.url=http://example.com')
105106
expect(result).toContain('-Ddevelocity.url=http://example.com')
107+
expect(result).toContain('-Dscan.value.CIAutoInjection=GitHub')
106108
})
107109

108110
it('injects CCUD Maven extension', async () => {

setup-maven/src/injection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function constructDevelocityMavenOpts(downloadFolder: string): Prom
3535
downloadFolder,
3636
credentials
3737
)
38-
develocityMavenExtensionMavenOpts = `${io.getDelimiter()}${develocityMavenExtensionJar} -Dgradle.enterprise.url=${input.getDevelocityUrl()} -Ddevelocity.url=${input.getDevelocityUrl()}`
38+
develocityMavenExtensionMavenOpts = `${io.getDelimiter()}${develocityMavenExtensionJar} -Dgradle.enterprise.url=${input.getDevelocityUrl()} -Ddevelocity.url=${input.getDevelocityUrl()} -Dscan.value.CIAutoInjection=GitHub`
3939
if (input.getDevelocityAllowUntrustedServer()) {
4040
develocityMavenExtensionMavenOpts = `${develocityMavenExtensionMavenOpts} -Ddevelocity.allowUntrustedServer=${input.getDevelocityAllowUntrustedServer()}`
4141
}

setup-npm/src/injection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ function configureEnvironment(wrappersDir: string): void {
130130
if (allowUntrustedServer) {
131131
core.exportVariable('DEVELOCITY_ALLOW_UNTRUSTED_SERVER', allowUntrustedServer)
132132
}
133+
core.exportVariable('DEVELOCITY_VALUE_CIAutoInjection', 'GitHub')
133134
}
134135

135136
async function findAndVerifyBinary(binaryName: string): Promise<string> {

0 commit comments

Comments
 (0)