Skip to content

Commit

Permalink
chore: change typescript to javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol-Baranwal committed Oct 15, 2023
1 parent ebf22a3 commit 53b786a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 39 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20
node-version: 14

- name: Install Dependencies
run: npm install

- name: Compile TypeScript
run: npx tsc

- name: Run Custom Action
run: |
node dist/index.js
run: node index.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 4 additions & 7 deletions index.ts → index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// import * as core from "@actions/core";
// import * as github from "@actions/github";

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

async function run() {
try {
Expand Down Expand Up @@ -73,7 +70,7 @@ async function run() {
// Add comments based on conditions
if (issueNumber) {
const issueLink = `#${issueNumberToLabel}`;
let commentText: string = "";
let commentText = "";

if (!comment) {
// Condition 1: issueNumber is true, comment is false
Expand Down Expand Up @@ -116,7 +113,7 @@ async function run() {
core.notice("Issue #" + issueNumberToLabel + " closed");
}
}
} catch (error: any) {
} catch (error) {
core.error("No Issue found!");
core.setFailed("Workflow failed: " + error.message);

Expand Down
15 changes: 4 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{
"name": "close-multiple-issues",
"version": "1.0.0",
"description": "to take actions of multiple issues created by same author",
"main": "dist/index.js",
"scripts": {
"test": "npm test",
"build": "tsc",
"workflow": "npm run build && node dist/index.js"
},
"description": "To take actions on multiple issues created by the same author",
"main": "index.js",
"keywords": [
"action",
"github",
Expand All @@ -17,10 +12,8 @@
],
"author": "Anmol-Baranwal",
"license": "ISC",
"devDependencies": {
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@types/node": "^20.8.6",
"typescript": "^5.2.2"
"@actions/github": "^6.0.0"
}
}
15 changes: 0 additions & 15 deletions tsconfig.json

This file was deleted.

0 comments on commit 53b786a

Please sign in to comment.