From 2c036efa4bcc4eb3e168119dcd4adbe8c88f2970 Mon Sep 17 00:00:00 2001 From: Naveenraj M Date: Wed, 1 Apr 2020 00:23:08 +0530 Subject: [PATCH] deleted download-archive function --- src/download-release-archive.ts | 43 --------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/download-release-archive.ts diff --git a/src/download-release-archive.ts b/src/download-release-archive.ts deleted file mode 100644 index a74cd10..0000000 --- a/src/download-release-archive.ts +++ /dev/null @@ -1,43 +0,0 @@ -const { Octokit } = require('@octokit/rest'); -//const fs = require('fs'); -const tc = require('@actions/tool-cache'); - - -async function download_archive(owner, repo, ref ) { - try { - - const octokit = new Octokit(); - - const archive_format = "tarball"; - - const tag = "v1.0.0" - - const tarFile = `${repo}-1.0.tar.gz`; - - console.log("Calling API ..."); - await octokit.repos.getArchiveLink({ - owner, - repo, - archive_format, - ref - }).then(( { data }) => { - fs.writeFile(tarFile, Buffer.from(data), function(err){ - if(err) { - return console.log(err); - } - console.log("The Tar file was saved!"); - console.log(`Tarball Location : ${tarFile}`); - return tarFile; - }); - }).catch( function(error){ - console.log(error); - }); - - - - } catch (error) { - core.setFailed(error.message); - } -} - -module.exports = download_archive;