Skip to content

Commit 33d2211

Browse files
fix: remove redundant variable assignment for input processing
1 parent da16488 commit 33d2211

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const axios = require("axios");
22
const core = require("@actions/core");
33
const exec = require("@actions/exec");
4-
const fs = require("fs");
4+
const fs = require("fs").promises;
55
const tar = require("tar");
66
const { Octokit } = require("@octokit/rest");
77

88
const token = process.env["GITHUB_TOKEN"];
99
const octokit = new Octokit({ auth: `token ${token}` });
1010

1111
const commit = core.getInput("commit");
12-
const filePath = core.getInput("secrets-file");
12+
const secretsFilePath = core.getInput("secrets-file");
1313

1414
async function downloadFile(url, outputPath) {
1515
const writer = require("fs").createWriteStream(outputPath);
@@ -24,7 +24,7 @@ async function downloadFile(url, outputPath) {
2424
async function checkForSecrets() {
2525
let secretsDetected = false;
2626

27-
const data = await fs.promises.readFile(filePath, "utf8");
27+
const data = await fs.readFile(secretsFilePath, "utf8");
2828
if (!data || data.trim().length === 0) {
2929
console.log("No data or empty file found, skipping processing...");
3030
return secretsDetected;
@@ -103,8 +103,6 @@ async function run() {
103103
);
104104
await tar.x({ file: tarballPath });
105105

106-
const secretsFilePath = core.getInput("secrets-file");
107-
108106
let output = "";
109107
const options = {
110108
listeners: {

0 commit comments

Comments
 (0)