mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
[bot] Update dist directory
This commit is contained in:
committed by
github-actions[bot]
parent
83709b49fe
commit
094f2191c5
22
dist/wrapper-validation/main/index.js
vendored
22
dist/wrapper-validation/main/index.js
vendored
@@ -126806,7 +126806,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.KNOWN_CHECKSUMS = exports.WrapperChecksums = void 0;
|
||||
exports.fetchUnknownChecksums = fetchUnknownChecksums;
|
||||
exports.addDistributionSnapshotChecksums = addDistributionSnapshotChecksums;
|
||||
const httpm = __importStar(__nccwpck_require__(96184));
|
||||
const cheerio = __importStar(__nccwpck_require__(36962));
|
||||
const wrapper_checksums_json_1 = __importDefault(__nccwpck_require__(46629));
|
||||
@@ -126840,14 +126839,16 @@ async function fetchUnknownChecksums(allowSnapshots, knownChecksums) {
|
||||
const withChecksum = all.filter(entry => typeof entry === 'object' && entry != null && entry.hasOwnProperty('wrapperChecksumUrl'));
|
||||
const allowed = withChecksum.filter((entry) => allowSnapshots || !entry.snapshot);
|
||||
const notKnown = allowed.filter((entry) => !knownChecksums.versions.has(entry.version));
|
||||
const checksumUrls = notKnown.map((entry) => entry.wrapperChecksumUrl);
|
||||
const checksumUrls = notKnown.map((entry) => [entry.version, entry.wrapperChecksumUrl]);
|
||||
if (allowSnapshots) {
|
||||
await addDistributionSnapshotChecksums(checksumUrls);
|
||||
await addDistributionSnapshotChecksumUrls(checksumUrls);
|
||||
}
|
||||
const checksums = await Promise.all(checksumUrls.map(async (url) => {
|
||||
return httpGetText(url);
|
||||
const wrapperChecksums = new WrapperChecksums();
|
||||
await Promise.all(checksumUrls.map(async ([version, url]) => {
|
||||
const checksum = await httpGetText(url);
|
||||
wrapperChecksums.add(version, checksum);
|
||||
}));
|
||||
return new Set(checksums);
|
||||
return wrapperChecksums;
|
||||
}
|
||||
async function httpGetJsonArray(url) {
|
||||
return JSON.parse(await httpGetText(url));
|
||||
@@ -126856,13 +126857,16 @@ async function httpGetText(url) {
|
||||
const response = await httpc.get(url);
|
||||
return await response.readBody();
|
||||
}
|
||||
async function addDistributionSnapshotChecksums(checksumUrls) {
|
||||
async function addDistributionSnapshotChecksumUrls(checksumUrls) {
|
||||
const indexPage = await httpGetText('https://services.gradle.org/distributions-snapshots/');
|
||||
const $ = cheerio.load(indexPage);
|
||||
const wrapperChecksumLinks = $('a[href$="-wrapper.jar.sha256"]');
|
||||
wrapperChecksumLinks.each((index, element) => {
|
||||
const url = $(element).attr('href');
|
||||
checksumUrls.push(`https://services.gradle.org${url}`);
|
||||
const version = url.match(/\/distributions-snapshots\/gradle-(.*?)-wrapper\.jar\.sha256/)?.[1];
|
||||
if (version) {
|
||||
checksumUrls.push([version, `https://services.gradle.org${url}`]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -127041,7 +127045,7 @@ async function findInvalidWrapperJars(gitRepoRoot, allowSnapshots, allowedChecks
|
||||
result.fetchedChecksums = true;
|
||||
const fetchedValidChecksums = await checksums.fetchUnknownChecksums(allowSnapshots, knownValidChecksums);
|
||||
for (const wrapperJar of notYetValidatedWrappers) {
|
||||
if (!fetchedValidChecksums.has(wrapperJar.checksum)) {
|
||||
if (!fetchedValidChecksums.checksums.has(wrapperJar.checksum)) {
|
||||
result.invalid.push(wrapperJar);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user