From bb22848287f002f423bfcc108bec19887a062822 Mon Sep 17 00:00:00 2001 From: Belden Lyman Date: Fri, 17 Sep 2021 16:48:09 -0700 Subject: [PATCH] Remove lib/download-release-archive.js * Introduced in 281f2b8 * Replaced with `curl` in ab399dd * Typescript removed in 2c036ef * Import removed in 2ff761f * Compiled js finally removed in whatever sha this is Tracking down the history of this file was kind of fun because I could see how @naveenrajm7's thinking evolved for getting the repo source into the rpmbuild SOURCES directory. --- lib/download-release-archive.js | 45 --------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 lib/download-release-archive.js diff --git a/lib/download-release-archive.js b/lib/download-release-archive.js deleted file mode 100644 index 348a884..0000000 --- a/lib/download-release-archive.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const { Octokit } = require('@octokit/rest'); -//const fs = require('fs'); -const tc = require('@actions/tool-cache'); -function download_archive(owner, repo, ref) { - return __awaiter(this, void 0, void 0, function* () { - 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 ..."); - yield 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;