Skip to content

Commit

Permalink
[fix] release
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfu committed Feb 2, 2024
1 parent 572f6ba commit 498014e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 50 deletions.
68 changes: 34 additions & 34 deletions dist/index.js

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions lib/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports.createNote = async function (argv, useOrigin) {
const currentVersion = argv.pullRequestTitle.split(" v")?.[1];
const lastVersion = getLastVersion(currentVersion);
const notes = [
...(await printRootNote(argv, currentVersion, lastVersion)),
...(await printRootNote(argv, currentVersion)),
...(await printDepNote(
argv,
octokit,
Expand Down Expand Up @@ -51,12 +51,12 @@ exports.teleportNotes = async function (argv) {
}
};

const printRootNote = async (argv, currentVersion, lastVersion) => {
const printRootNote = async (argv, currentVersion) => {
const records = await getRecordFromAirtable(argv, {
repo: argv.repo,
version: currentVersion,
});
return groupByRecords(argv.repo, records, `${argv.repo} ${lastVersion}->${currentVersion}`);
return groupByRecords(argv.repo, records, `${argv.repo} ${currentVersion}`);
};

const printDepNote = async (
Expand Down Expand Up @@ -156,30 +156,34 @@ const compareVersion = async (argv, current, last, pkgName, repoSet) => {
try {
const [cmajor, cminor, cpatch] = semverParse(current);
const [lmajor, lminor, lpatch] = semverParse(last);
let pkgs = new Set();
if (cmajor !== lmajor || cminor !== lminor) {
return;
}
let result = [];
for await (const idx of Array.from({
length: cpatch - lpatch + 1,
}).keys()) {
const version = `${cmajor}.${cminor}.${+lpatch + +idx}`;
const records = await getRecordFromAirtable(argv, {
pkgName,
version: `${cmajor}.${cminor}.${+lpatch + +idx}`,
version,
});
const repo = records?.[0]?.repo;
if (repo && records?.[0].pkgName.includes(pkgName)) {
records?.[0].pkgName.forEach((v) => repoSet.add(v));
const pkgNames = records?.[0]?.pkgName || [];
if (repo && pkgs && pkgNames.includes(pkgName) && pkgNames.every(v => !repoSet.has(v))) {
pkgNames.forEach((v) => pkgs.add(v));
result = [
...groupByRecords(
repo,
records,
`The following dependencies repo are updated ${repo} ${last}->${current} `
`The following dependencies repo are updated ${repo} ${version} `
),
...result,
];
}
}
pkgs.forEach((v) => repoSet.add(v));
return compareVersionCollect(current, last, result);
} catch (e) {
console.error(e);
Expand Down
18 changes: 9 additions & 9 deletions lib/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ const refreshFullDose = async (argv) => {
.reverse();
console.log("records", records.length);
for (const record of records) {
const { changed } = await createRecords(
{
...argv,
pullRequestNumber: record.number,
pullRequestTitle: record.title,
repo: argv.fullDoseRepo,
},
pulls
);
// const { changed } = await createRecords(
// {
// ...argv,
// pullRequestNumber: record.number,
// pullRequestTitle: record.title,
// repo: argv.fullDoseRepo,
// },
// pulls
// );
await createNote(
{
...argv,
Expand Down

0 comments on commit 498014e

Please sign in to comment.