Skip to content

Commit

Permalink
chore: update syntax and unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol-Baranwal committed Oct 16, 2023
1 parent 37917cf commit d1fa81e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
13 changes: 5 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: "Close Multiple Issues from Same Author"
description: "Custom GitHub Action to close multiple issues from the same author."
description: "GitHub Action to handle the current issue if the author has existing open issues."
inputs:
label:
description: "Label to add to the new issue"
description: "Label to add to the current issue."
required: true
default: "true"
issueNumber:
description: "Include issue number in the comment"
required: false
description: "Include the previous issue number created by the author in the comment."
default: "false"
comment:
description: "Custom text to add after the issue number in the comment"
required: false
description: "Custom text to add with or without the issue number in the comment."
default: "false"
close:
description: "Close the previous issue if set to true"
required: false
description: "Close the current issue if set to true."
default: "true"
runs:
using: "node20"
Expand Down
22 changes: 9 additions & 13 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// import * as core from "@actions/core";
// import * as github from "@actions/github";
import * as core from "@actions/core";
import * as github from "@actions/github";

import core = require("@actions/core");
import github = require("@actions/github");
// import core = require("@actions/core");
// import github = require("@actions/github");

async function run() {
async function HandleMultipleIssues() {
try {
const token = process.env.GITHUB_TOKEN;

Expand All @@ -25,13 +25,9 @@ async function run() {

// Retrieve custom inputs
const label = core.getInput("label") || "up for grabs"; // Set default label
// const issueNumber = core.getInput("issueNumber") === "true"; // converts to boolean
// const comment = core.getInput("comment");
// const close = core.getInput("close") === "true";

const comment = "is assigned to u";
const issueNumber = true;
const close = true;
const issueNumber = core.getInput("issueNumber") === "true"; // converts to boolean
const comment = core.getInput("comment");
const close = core.getInput("close") === "true";

const checkComment = comment.trim() !== "";

Expand Down Expand Up @@ -139,4 +135,4 @@ async function run() {
}
}

run();
HandleMultipleIssues();

0 comments on commit d1fa81e

Please sign in to comment.