11const axios = require ( "axios" ) ;
22const core = require ( "@actions/core" ) ;
33const exec = require ( "@actions/exec" ) ;
4- const fs = require ( "fs" ) ;
4+ const fs = require ( "fs" ) . promises ;
55const tar = require ( "tar" ) ;
66const { Octokit } = require ( "@octokit/rest" ) ;
77
88const token = process . env [ "GITHUB_TOKEN" ] ;
99const octokit = new Octokit ( { auth : `token ${ token } ` } ) ;
1010
1111const commit = core . getInput ( "commit" ) ;
12- const filePath = core . getInput ( "secrets-file" ) ;
12+ const secretsFilePath = core . getInput ( "secrets-file" ) ;
1313
1414async function downloadFile ( url , outputPath ) {
1515 const writer = require ( "fs" ) . createWriteStream ( outputPath ) ;
@@ -24,7 +24,7 @@ async function downloadFile(url, outputPath) {
2424async 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