Skip to content

Commit

Permalink
GH Action Standards
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie authored and github-actions[bot] committed Feb 19, 2024
1 parent 9b3ed1f commit 8ec78df
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 64 deletions.
15 changes: 3 additions & 12 deletions src/controllers/deletePackagesPackageName.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ module.exports = {
if (!packageExists.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(packageExists)
.assignCalls(callStack);
return sso.notOk().addContent(packageExists).assignCalls(callStack);
}

// Get `owner/repo` string format from pacakge
Expand All @@ -76,10 +73,7 @@ module.exports = {
if (!gitowner.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(gitowner)
.assignCalls(callStack);
return sso.notOk().addContent(gitowner).assignCalls(callStack);
}

// Now they are logged in locally, and have permissions over the GitHub repo
Expand All @@ -90,10 +84,7 @@ module.exports = {
if (!rm.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(rm)
.assignCalls(callStack);
return sso.notOk().addContent(rm).assignCalls(callStack);
}

const sso = new context.sso();
Expand Down
5 changes: 1 addition & 4 deletions src/controllers/deletePackagesPackageNameStar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ module.exports = {
if (!unstar.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(unstar)
.assignCalls(callStack);
return sso.notOk().addContent(unstar).assignCalls(callStack);
}

const sso = new context.sso();
Expand Down
15 changes: 3 additions & 12 deletions src/controllers/deletePackagesPackageNameVersionsVersionName.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ module.exports = {
if (!packageExists.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(packageExists)
.assignCalls(callStack);
return sso.notOk().addContent(packageExists).assignCalls(callStack);
}

const gitowner = await context.vcs.ownership(
Expand All @@ -88,10 +85,7 @@ module.exports = {
if (!gitowner.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(gitowner)
.assignCalls(callStack);
return sso.notOk().addContent(gitowner).assignCalls(callStack);
}

// Mark the specified version for deletion, if version is valid
Expand All @@ -105,10 +99,7 @@ module.exports = {
if (!removeVersion.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(removeVersion)
.assignCalls(callStack);
return sso.notOk().addContent(removeVersion).assignCalls(callStack);
}

const sso = new context.sso();
Expand Down
5 changes: 1 addition & 4 deletions src/controllers/getOwnersOwnerName.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ module.exports = {
if (!packages.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(packages)
.assignCalls(callStack);
return sso.notOk().addContent(packages).assignCalls(callStack);
}

const packObjShort = await context.models.constructPackageObjectShort(
Expand Down
10 changes: 2 additions & 8 deletions src/controllers/getPackagesPackageNameStargazers.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ module.exports = {
if (!stars.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(stars)
.assignCalls(callStack);
return sso.notOk().addContent(stars).assignCalls(callStack);
}

const gazers = await context.database.getUserCollectionById(stars.content);
Expand All @@ -78,10 +75,7 @@ module.exports = {
if (!gazers.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(gazers)
.assignCalls(callStack);
return sso.notOk().addContent(gazers).assignCalls(callStack);
}

const sso = new context.sso();
Expand Down
5 changes: 1 addition & 4 deletions src/controllers/getPackagesPackageNameVersionsVersionName.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ module.exports = {
if (!pack.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(pack)
.assignCalls(callStack);
return sso.notOk().addContent(pack).assignCalls(callStack);
}

const packRes = await context.models.constructPackageObjectJSON(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ module.exports = {
if (!pack.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(pack)
.assignCalls(callStack);
return sso.notOk().addContent(pack).assignCalls(callStack);
}

const save = await context.database.updatePackageIncrementDownloadByName(
Expand Down
10 changes: 2 additions & 8 deletions src/controllers/getStars.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ module.exports = {
if (!userStars.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(userStars)
.assignCalls(callStack);
return sso.notOk().addContent(userStars).assignCalls(callStack);
}

if (userStars.content.length === 0) {
Expand All @@ -87,10 +84,7 @@ module.exports = {
if (!packCol.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(packCol)
.assignCalls(callStack);
return sso.notOk().addContent(packCol).assignCalls(callStack);
}

let newCol = await context.models.constructPackageObjectShort(
Expand Down
10 changes: 2 additions & 8 deletions src/controllers/getUsersLoginStars.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ module.exports = {
if (!pointerCollection.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(pointerCollection)
.assignCalls(callStack);
return sso.notOk().addContent(pointerCollection).assignCalls(callStack);
}

// Since even if the pointerCollection is okay, it could be empty. Meaning the user
Expand All @@ -81,10 +78,7 @@ module.exports = {
if (!packageCollection.ok) {
const sso = new context.sso();

return sso
.notOk()
.addContent(packageCollection)
.assignCalls(callStack);
return sso.notOk().addContent(packageCollection).assignCalls(callStack);
}

packageCollection = await utils.constructPackageObjectShort(
Expand Down

0 comments on commit 8ec78df

Please sign in to comment.