Skip to content

Commit 0409f90

Browse files
committed
fix: sync dist
1 parent 0d5ac12 commit 0409f90

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

dist/main.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15166,13 +15166,21 @@ var getGitHubContributors = async (token) => {
1516615166
owner,
1516715167
repo
1516815168
});
15169-
const contributors = await Promise.all(contributorList.filter(({ type }) => type === "User").map((user) => octokit.request("GET /users/{username}", { username: user.login }).then(({ data }) => data)));
15169+
const contributors = await Promise.all(contributorList.filter(({ type }) => type === "User").map((user) => octokit.rest.users.getByUsername({ username: user.login }).then(({ data }) => data)));
15170+
const currentActor = import_process.default.env.GITHUB_ACTOR;
15171+
if (!contributorList.some((user) => user.login === currentActor)) {
15172+
const { data: currentUser } = await octokit.rest.users.getByUsername({ username: currentActor });
15173+
if (currentUser.type === "User") {
15174+
return [...contributors, currentUser];
15175+
}
15176+
}
1517015177
return contributors;
1517115178
};
1517215179
var updatePackageJson = async (contributors) => {
1517315180
const jsonFile = JSON.parse(await import_fs.promises.readFile("package.json", "utf8"));
1517415181
jsonFile.contributors = contributors;
15175-
await import_fs.promises.writeFile("package.json", JSON.stringify(jsonFile, null, 2), "utf-8");
15182+
await import_fs.promises.writeFile("package.json", `${JSON.stringify(jsonFile, null, 2)}
15183+
`, "utf-8");
1517615184
};
1517715185
var updateContributors = async (token) => {
1517815186
const [mailList, packageJson, contributors] = await Promise.all([
@@ -15190,7 +15198,7 @@ var updateContributors = async (token) => {
1519015198
}
1519115199
return createContributorString({ name: fullName, email, url });
1519215200
});
15193-
return updatePackageJson(newContributors);
15201+
return updatePackageJson(newContributors.sort());
1519415202
};
1519515203

1519615204
// src/main.ts

0 commit comments

Comments
 (0)