Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
  • Loading branch information
j10a1n15 committed Aug 13, 2024
1 parent 3674dd0 commit 49c06b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/scripts/checkDependencies.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {Octokit} from "@octokit/rest";
import fetch from "node-fetch";

const labelName = "Waiting on Dependency PR";

async function run() {
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
Expand Down Expand Up @@ -44,19 +46,19 @@ async function run() {

const labels = pull_request.labels.map(label => label.name);

if (hasOpenDependencies && !labels.includes("Waiting on Dependency PR")) {
if (hasOpenDependencies && !labels.includes(labelName)) {
await octokit.issues.addLabels({
owner,
repo: name,
issue_number: prNumber,
labels: ["Waiting on Dependency PR"],
labels: [labelName],
});
} else if (!hasOpenDependencies && labels.includes("Waiting on Dependency PR")) {
} else if (!hasOpenDependencies && labels.includes(labelName)) {
await octokit.issues.removeLabel({
owner,
repo: name,
issue_number: prNumber,
name: "Waiting on Dependency PR",
name: labelName,
});
}
}
Expand Down

0 comments on commit 49c06b8

Please sign in to comment.