Skip to content

Commit

Permalink
chore: change metadata with appropriate name and license
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol-Baranwal committed Nov 11, 2023
1 parent c4fff91 commit a0c5354
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Close Multiple Issues from Same Author
name: Handle Multiple Issues from Same Author
on:
issues:
types:
- reopened
- opened
workflow_dispatch:
push: { branches: ["master", "main", "testing"] }
push: { branches: ["main", "testing"] }

jobs:
close-multiple-issues:
Expand All @@ -14,4 +14,5 @@ jobs:
- uses: actions/checkout@v3
- uses: ./
with:
issueNumber: true
gh-token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "Close Multiple Issues from Same Author"
name: "Handle Multiple Issues from Same Author"
description: "GitHub Action to handle the current issue if the author has existing open issues."
author: "Anmol Baranwal"
inputs:
label:
description: "Label to add to the current issue."
required: false
default: "up for grabs"
default: "multiple issues"
issueNumber:
description: "Include the previous issue number created by the author in the comment."
comment:
Expand Down
6 changes: 2 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438));
// const core = require("@actions/core");
// const github = require("@actions/github");
async function HandleMultipleIssues() {
var _a;
console.log("Hello World!");
try {
// const token = process.env.GITHUB_TOKEN;
const token = core.getInput("gh-token");
if (!token)
core.debug(token + "");
Expand All @@ -52,7 +49,8 @@ async function HandleMultipleIssues() {
const context = github.context;
core.notice("step 1.");
// Retrieve custom inputs
const label = core.getInput("label") || "up for grabs"; // Set default label
const label = core.getInput("label") || "multiple issues"; // Set default label
const labelInput = core.getInput("label");
const issueNumber = core.getInput("issueNumber") === "true" || false; // converts to boolean
const comment = core.getInput("comment");
const close = core.getInput("close") === "true" || false;
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "close-multiple-issues",
"name": "handle-multiple-issues",
"version": "1.0.0",
"description": "to take actions of multiple issues created by same author",
"description": "GitHub Action workflow designed to take actions on multiple issues created by the same author.",
"main": "dist/index.js",
"scripts": {
"test": "npm test",
Expand All @@ -10,16 +10,16 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Anmol-Baranwal/close-multiple-issues.git"
"url": "git+https://github.com/Anmol-Baranwal/handle-multiple-issues.git"
},
"bugs": {
"url": "https://github.com/Anmol-Baranwal/close-multiple-issues/issues"
"url": "https://github.com/Anmol-Baranwal/handle-multiple-issues/issues"
},
"homepage": "https://github.com/Anmol-Baranwal/close-multiple-issues#readme",
"homepage": "https://github.com/Anmol-Baranwal/handle-multiple-issues#readme",
"keywords": [
"action",
"github",
"duplicate",
"same author",
"issues",
"close",
"label",
Expand All @@ -30,7 +30,7 @@
".": "./dist/index.js"
},
"author": "Anmol-Baranwal <[email protected]> (https://github.com/Anmol-Baranwal)",
"license": "GPL-3.0-only",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
Expand Down
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ async function HandleMultipleIssues() {
core.notice("step 1.");

// Retrieve custom inputs
// const label = core.getInput("label") || "up for grabs"; // Set default label
const label = core.getInput("label") || "multiple issues"; // Set default label
const labelInput = core.getInput("label");
const labels = labelInput ? labelInput.split(",") : ["up for grabs"];
const issueNumber = core.getInput("issueNumber") === "true" || false; // converts to boolean
const comment = core.getInput("comment");
const close = core.getInput("close") === "true" || false;
Expand Down Expand Up @@ -63,8 +62,8 @@ async function HandleMultipleIssues() {
.join(", ");

// Check if label is an array and add multiple labels if needed
if (Array.isArray(labels) && labels.length > 0) {
for (const lbl of labels) {
if (Array.isArray(label)) {
for (const lbl of label) {
await octokit.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -78,7 +77,7 @@ async function HandleMultipleIssues() {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumberToLabel,
labels: [labels[0]],
labels: [label],
});
}

Expand Down

0 comments on commit a0c5354

Please sign in to comment.