New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

auri

Package Overview
Dependencies
Maintainers
0
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auri - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

78

dist/scripts/publish.js

@@ -31,2 +31,5 @@ import * as fs from "fs/promises";

}
const user = await getGitUser(githubToken);
childprocess.execSync(`git config --global user.name "${user.name}"`);
childprocess.execSync(`git config --global user.email "${user.email}"`);
const releaseTag = calculateReleaseTag(metadata.version, publishedVersions);

@@ -185,1 +188,76 @@ try {

}
async function getGitUser(token) {
const userResponse = await fetch("https://api.github.com/user", {
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json"
}
});
if (!userResponse.ok) {
if (userResponse.body !== null) {
await userResponse.body.cancel();
}
throw new Error("Failed to fetch data from GitHub");
}
const githubUserJSON = await userResponse.json();
if (typeof githubUserJSON !== "object" || githubUserJSON === null) {
throw new Error("Failed to fetch data from GitHub");
}
let username;
if ("login" in githubUserJSON && typeof githubUserJSON.login === "string") {
username = githubUserJSON.login;
}
else {
throw new Error("Failed to fetch data from GitHub");
}
const emailsResponse = await fetch("https://api.github.com/user/emails", {
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json"
}
});
if (!emailsResponse.ok) {
if (emailsResponse.body !== null) {
await emailsResponse.body.cancel();
}
throw new Error("Failed to fetch data from GitHub");
}
const githubEmailsJSON = await emailsResponse.json();
if (!Array.isArray(githubEmailsJSON)) {
throw new Error("Failed to fetch data from GitHub");
}
for (const emailJSON of githubEmailsJSON) {
if (typeof emailJSON !== "object" || emailJSON === null) {
throw new Error("Failed to fetch data from GitHub");
}
let email;
if ("email" in emailJSON && typeof emailJSON.email === "string") {
email = emailJSON.email;
}
else {
throw new Error("Failed to fetch data from GitHub");
}
let emailVerified;
if ("verified" in emailJSON && typeof emailJSON.verified === "boolean") {
emailVerified = emailJSON.verified;
}
else {
throw new Error("Failed to fetch data from GitHub");
}
let primaryEmail;
if ("primary" in emailJSON && typeof emailJSON.primary === "boolean") {
primaryEmail = emailJSON.primary;
}
else {
throw new Error("Failed to fetch data from GitHub");
}
if (emailVerified && primaryEmail) {
const gitUser = {
email: email,
name: username
};
return gitUser;
}
}
throw new Error("User email not verified");
}

2

package.json
{
"name": "auri",
"version": "3.0.1",
"version": "3.0.2",
"description": "Organize package changes and releases",

@@ -5,0 +5,0 @@ "type": "module",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc