Skip to content

Commit

Permalink
Build outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz committed Jun 5, 2022
1 parent 3f2d9cd commit b400dc5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
17 changes: 8 additions & 9 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64967,6 +64967,7 @@ class GradleStateCache {
fs_1.default.appendFileSync(propertiesFile, 'org.gradle.daemon=false');
const initScriptFilenames = [
'build-result-capture.init.gradle',
'build-result-capture-service.plugin.groovy',
'project-root-capture.init.gradle',
'project-root-capture.plugin.groovy'
];
Expand Down Expand Up @@ -65291,7 +65292,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
});
}
getProjectRoots() {
const projectList = path_1.default.resolve(this.gradleUserHome, cache_base_1.PROJECT_ROOTS_FILE);
const projectList = path_1.default.resolve(process.env['RUNNER_TEMP'], cache_base_1.PROJECT_ROOTS_FILE);
if (!fs_1.default.existsSync(projectList)) {
core.info(`Missing project list file ${projectList}`);
return [];
Expand Down Expand Up @@ -65559,7 +65560,7 @@ function isCacheDisabled() {
}
exports.isCacheDisabled = isCacheDisabled;
function isCacheReadOnly() {
return core.getBooleanInput(CACHE_READONLY_PARAMETER);
return !isCacheWriteOnly() && core.getBooleanInput(CACHE_READONLY_PARAMETER);
}
exports.isCacheReadOnly = isCacheReadOnly;
function isCacheWriteOnly() {
Expand Down Expand Up @@ -66031,14 +66032,12 @@ function writeSummaryTable(results) {
core.summary.addRaw('\n');
}
function renderOutcome(result) {
const badgeUrl = result.buildFailed
? 'https://img.shields.io/badge/Build%20Scan%E2%84%A2-FAILED-red?logo=Gradle'
: 'https://img.shields.io/badge/Build%20Scan%E2%84%A2-SUCCESS-brightgreen?logo=Gradle';
const labelPart = result.buildScanUri ? 'Build%20Scan%E2%84%A2' : 'Build';
const outcomePart = result.buildFailed ? 'FAILED-red' : 'SUCCESS-brightgreen';
const badgeUrl = `https://img.shields.io/badge/${labelPart}-${outcomePart}?logo=Gradle`;
const badgeHtml = `<img src="${badgeUrl}" alt="Gradle Build">`;
if (result.buildScanUri) {
return `<a href="${result.buildScanUri}" rel="nofollow">${badgeHtml}</a>`;
}
return badgeHtml;
const targetUrl = result.buildScanUri ? result.buildScanUri : '#';
return `<a href="${targetUrl}" rel="nofollow">${badgeHtml}</a>`;
}


Expand Down
2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions dist/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64018,6 +64018,7 @@ class GradleStateCache {
fs_1.default.appendFileSync(propertiesFile, 'org.gradle.daemon=false');
const initScriptFilenames = [
'build-result-capture.init.gradle',
'build-result-capture-service.plugin.groovy',
'project-root-capture.init.gradle',
'project-root-capture.plugin.groovy'
];
Expand Down Expand Up @@ -64342,7 +64343,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
});
}
getProjectRoots() {
const projectList = path_1.default.resolve(this.gradleUserHome, cache_base_1.PROJECT_ROOTS_FILE);
const projectList = path_1.default.resolve(process.env['RUNNER_TEMP'], cache_base_1.PROJECT_ROOTS_FILE);
if (!fs_1.default.existsSync(projectList)) {
core.info(`Missing project list file ${projectList}`);
return [];
Expand Down Expand Up @@ -64610,7 +64611,7 @@ function isCacheDisabled() {
}
exports.isCacheDisabled = isCacheDisabled;
function isCacheReadOnly() {
return core.getBooleanInput(CACHE_READONLY_PARAMETER);
return !isCacheWriteOnly() && core.getBooleanInput(CACHE_READONLY_PARAMETER);
}
exports.isCacheReadOnly = isCacheReadOnly;
function isCacheWriteOnly() {
Expand Down Expand Up @@ -64951,14 +64952,12 @@ function writeSummaryTable(results) {
core.summary.addRaw('\n');
}
function renderOutcome(result) {
const badgeUrl = result.buildFailed
? 'https://img.shields.io/badge/Build%20Scan%E2%84%A2-FAILED-red?logo=Gradle'
: 'https://img.shields.io/badge/Build%20Scan%E2%84%A2-SUCCESS-brightgreen?logo=Gradle';
const labelPart = result.buildScanUri ? 'Build%20Scan%E2%84%A2' : 'Build';
const outcomePart = result.buildFailed ? 'FAILED-red' : 'SUCCESS-brightgreen';
const badgeUrl = `https://img.shields.io/badge/${labelPart}-${outcomePart}?logo=Gradle`;
const badgeHtml = `<img src="${badgeUrl}" alt="Gradle Build">`;
if (result.buildScanUri) {
return `<a href="${result.buildScanUri}" rel="nofollow">${badgeHtml}</a>`;
}
return badgeHtml;
const targetUrl = result.buildScanUri ? result.buildScanUri : '#';
return `<a href="${targetUrl}" rel="nofollow">${badgeHtml}</a>`;
}


Expand Down
2 changes: 1 addition & 1 deletion dist/post/index.js.map

Large diffs are not rendered by default.

0 comments on commit b400dc5

Please sign in to comment.