Skip to content

Commit

Permalink
squash!
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Jul 9, 2024
1 parent df544b6 commit a93b060
Show file tree
Hide file tree
Showing 26 changed files with 242 additions and 84 deletions.
1 change: 1 addition & 0 deletions .github/workflows/GitHub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
STNOUPGRADE: 1
STRIPE_CLI_TELEMETRY_OPTOUT: 1
TELEMETRY_DISABLED: 1
TERRAFORM_TELEMETRY: 0

steps:
- uses: pozil/[email protected]
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/NPM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,38 @@ jobs:
Publish:
runs-on: ubuntu-latest

env:
ADBLOCK: true
ASTRO_TELEMETRY_DISABLED: 1
AUTOMATEDLAB_TELEMETRY_OPTOUT: 1
AZURE_CORE_COLLECT_TELEMETRY: 0
CHOOSENIM_NO_ANALYTICS: 1
DIEZ_DO_NOT_TRACK: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1
DO_NOT_TRACK: 1
ET_NO_TELEMETRY: 1
GATSBY_TELEMETRY_DISABLED: 1
GATSBY_TELEMETRY_OPTOUT: 1
GATSBY_TELEMETRY_OPT_OUT: 1
GRIT_TELEMETRY_DISABLED: 1
HASURA_GRAPHQL_ENABLE_TELEMETRY: false
HINT_TELEMETRY: off
HOMEBREW_NO_ANALYTICS: 1
INFLUXD_REPORTING_DISABLED: true
ITERATIVE_DO_NOT_TRACK: 1
NEXT_TELEMETRY_DEBUG: 1
NEXT_TELEMETRY_DISABLED: 1
NG_CLI_ANALYTICS: false
NUXT_TELEMETRY_DISABLED: 1
PIN_DO_NOT_TRACK: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
SAM_CLI_TELEMETRY: 0
STNOUPGRADE: 1
STRIPE_CLI_TELEMETRY_OPTOUT: 1
TELEMETRY_DISABLED: 1
TERRAFORM_TELEMETRY: 0

permissions:
contents: read
id-token: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/Node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
STNOUPGRADE: 1
STRIPE_CLI_TELEMETRY_OPTOUT: 1
TELEMETRY_DISABLED: 1
TERRAFORM_TELEMETRY: 0

strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions Source/Command/Clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default async (Repositories: string[] = []) => {
}

// start: repos
// biome-ignore lint/nursery/noEvolvingTypes:
let Pass = null;

for (const Repository of All.Repositories) {
Expand Down
18 changes: 13 additions & 5 deletions Source/Command/Cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export default async () =>
for (const [_Directory, FilesPackage] of await (
await import("@Function/Directory.js")
).default(
await (await import("@Function/Package.js")).default("Cloudflare"),
await (await import("@Function/Package.js")).default(
"Cloudflare",
),
)) {
const GitHub = `${_Directory}/.github`;
const Base = await File();
Expand Down Expand Up @@ -70,17 +72,23 @@ export default async () =>

if (Base.size > 1) {
try {
await (await import("fs/promises")).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}

try {
await (await import("fs/promises")).writeFile(
`${GitHub}${Path}${Name}`,
`${[...Base].join("")}`.replaceAll("$Branch$", Branch),
`${[...Base].join("")}`.replaceAll(
"$Branch$",
Branch,
),
);
} catch {
console.log(
Expand Down
53 changes: 28 additions & 25 deletions Source/Command/Dependabot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,45 @@ export default async () =>
if (Environment !== "Cloudflare") {
Base.add(`
- package-ecosystem: "${
typeof Environment !== "undefined"
? String(Environment).toLowerCase()
: (() => {
switch (Package.split(".").pop()) {
case "csproj":
return "nuget";
default:
return "npm";
}
})()
}"
typeof Environment !== "undefined"
? String(Environment).toLowerCase()
: (() => {
switch (Package.split(".").pop()) {
case "csproj":
return "nuget";
default:
return "npm";
}
})()
}"
directory: "${Directory ? Directory : "/"}"
schedule:
interval: "daily"
versioning-strategy: ${
typeof Environment !== "undefined"
? (() => {
switch (Environment) {
case "Cargo":
return "lockfile-only";
default:
return "increase";
}
})()
: "increase"
}
typeof Environment !== "undefined"
? (() => {
switch (Environment) {
case "Cargo":
return "lockfile-only";
default:
return "increase";
}
})()
: "increase"
}
`);
}
}
}

if (Base.size > 0) {
try {
await (await import("fs/promises")).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}
Expand Down
12 changes: 7 additions & 5 deletions Source/Command/Dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default async (Repository: string[] | Set<string> = []) => {
name: org.login,
});

for (const repo of (await Request(`GET /orgs/${org.login}/repos`))?.data) {
for (const repo of (await Request(`GET /orgs/${org.login}/repos`))
?.data) {
Repositories.push({
owner: org.login,
name: repo.name,
Expand All @@ -37,19 +38,20 @@ export default async (Repository: string[] | Set<string> = []) => {
}

// start: repos
let pass: boolean | undefined = undefined;
// biome-ignore lint/nursery/noEvolvingTypes:
let Pass = null;

for (const { name, owner } of Repositories) {
/* Checking if the repository is in the list of repositories. */
for (const repository of Repository) {
if (name === repository) {
pass = true;
Pass = true;
} else {
pass = false;
Pass = false;
}
}

if (typeof pass === "undefined" || pass) {
if (Pass === null || Pass) {
// start: actions/workflows
for (const Workflow of (
await Request(`GET /repos/${owner}/${name}/actions/workflows`, {
Expand Down
12 changes: 7 additions & 5 deletions Source/Command/Edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export default async (_Repository: string[] | Set<string> = []) => {
name: string;
}[] = [];

for (const Repository of (await Request(`GET /users/${User}/repos`))?.data) {
for (const Repository of (await Request(`GET /users/${User}/repos`))
?.data) {
Repositories.push({
owner: User,
name: Repository.name,
Expand Down Expand Up @@ -63,18 +64,19 @@ export default async (_Repository: string[] | Set<string> = []) => {
// end: orgs

// start: repos
let pass = null;
// biome-ignore lint/nursery/noEvolvingTypes:
let Pass = null;

for (const repo of Repositories) {
for (const repository of _Repository) {
if (repo.name === repository) {
pass = true;
Pass = true;
} else {
pass = false;
Pass = false;
}
}

if (pass === null || pass) {
if (Pass === null || Pass) {
// start: vulnerability-alerts
await Request(
`PUT /repos/${repo.owner}/${repo.name}/vulnerability-alerts`,
Expand Down
9 changes: 6 additions & 3 deletions Source/Command/GitHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ export default async () =>

if (Base.size > 0) {
try {
await (await import("fs/promises")).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}
Expand Down
39 changes: 30 additions & 9 deletions Source/Command/NPM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default async () =>
for (const { Path, Name, File } of Files) {
for (const [_Directory, FilesPackage] of await (
await import("@Function/Directory.js")
).default(await (await import("@Function/Package.js")).default("NPM"))) {
).default(
await (await import("@Function/Package.js")).default("NPM"),
)) {
const GitHub = `${_Directory}/.github`;
const Base = await File();

Expand All @@ -25,24 +27,37 @@ export default async () =>
.replace(_Directory, "");

const FilePackage = (
await (await import("fs/promises")).readFile(Package, "utf-8")
await (
await import("fs/promises")
).readFile(Package, "utf-8")
).toString();

const Environment = (
await (await import("@Function/Type.js")).default()
).get(Package.split("/").pop());

try {
if (typeof Environment !== "undefined" && Environment === "NPM") {
if (
typeof Environment !== "undefined" &&
Environment === "NPM"
) {
const JSONPackage = JSON.parse(FilePackage);

for (const key in JSONPackage) {
if (Object.prototype.hasOwnProperty.call(JSONPackage, key)) {
if (
Object.prototype.hasOwnProperty.call(
JSONPackage,
key,
)
) {
const values = JSONPackage[key];
if (key === "scripts") {
for (const scripts in values) {
if (
Object.prototype.hasOwnProperty.call(values, scripts)
Object.prototype.hasOwnProperty.call(
values,
scripts,
)
) {
if (scripts === "build") {
Base.add(`
Expand All @@ -56,7 +71,10 @@ export default async () =>
`);
}

if (scripts === "prepublishOnly") {
if (
scripts ===
"prepublishOnly"
) {
Base.add(`
- name: Publish .${Directory}
continue-on-error: true
Expand Down Expand Up @@ -94,9 +112,12 @@ export default async () =>

if (Base.size > 1) {
try {
await (await import("fs/promises")).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}
Expand Down
Loading

0 comments on commit a93b060

Please sign in to comment.