Skip to content

Commit

Permalink
Merge pull request #15
Browse files Browse the repository at this point in the history
  • Loading branch information
therealdwright authored Oct 3, 2023
2 parents da16488 + 33d2211 commit d5fb3f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const axios = require("axios");
const core = require("@actions/core");
const exec = require("@actions/exec");
const fs = require("fs");
const fs = require("fs").promises;
const tar = require("tar");
const { Octokit } = require("@octokit/rest");

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

const commit = core.getInput("commit");
const filePath = core.getInput("secrets-file");
const secretsFilePath = core.getInput("secrets-file");

async function downloadFile(url, outputPath) {
const writer = require("fs").createWriteStream(outputPath);
Expand All @@ -24,7 +24,7 @@ async function downloadFile(url, outputPath) {
async function checkForSecrets() {
let secretsDetected = false;

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

const secretsFilePath = core.getInput("secrets-file");

let output = "";
const options = {
listeners: {
Expand Down

0 comments on commit d5fb3f1

Please sign in to comment.