diff --git a/lib/download-release-archive.js b/lib/download-release-archive.js index c99b393..34f8ad8 100644 --- a/lib/download-release-archive.js +++ b/lib/download-release-archive.js @@ -16,16 +16,18 @@ function download_archive(owner, repo, ref) { try { const octokit = new Octokit(); const archive_format = "tarball"; - const downloadLocation = octokit.repos.getArchiveLink({ + octokit.repos.getArchiveLink({ owner, repo, archive_format, ref + }).then(({ data }) => { + console.log(data); }); - console.log(`Download Location : ${downloadLocation}`); - const tarBallPath = yield tc.downloadTool(downloadLocation); - console.log(`Tarball Location : ${tarBallPath}`); - return tarBallPath; + //console.log(`Download Location : ${downloadLocation}`); + //const tarBallPath = await tc.downloadTool(downloadLocation); + //console.log(`Tarball Location : ${tarBallPath}`); + //return tarBallPath; } catch (error) { core.setFailed(error.message); diff --git a/lib/main.js b/lib/main.js index 3420c14..d3d9579 100644 --- a/lib/main.js +++ b/lib/main.js @@ -20,7 +20,7 @@ function run() { const context = github.context; const owner = context.repo.owner; const repo = context.repo.repo; - const ref = context.repo.ref; + const ref = context.ref; console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`); const tarBallPath = download_tar(owner, repo, ref); console.log(`Tar Path for copy : ${tarBallPath}`); diff --git a/src/download-release-archive.ts b/src/download-release-archive.ts index 03c4487..6c8cf4e 100644 --- a/src/download-release-archive.ts +++ b/src/download-release-archive.ts @@ -10,20 +10,22 @@ async function download_archive(owner, repo, ref ) { const archive_format = "tarball"; - const downloadLocation = octokit.repos.getArchiveLink({ + octokit.repos.getArchiveLink({ owner, repo, archive_format, ref + }).then(( { data }) => { + console.log(data) }); - console.log(`Download Location : ${downloadLocation}`); + //console.log(`Download Location : ${downloadLocation}`); - const tarBallPath = await tc.downloadTool(downloadLocation); + //const tarBallPath = await tc.downloadTool(downloadLocation); - console.log(`Tarball Location : ${tarBallPath}`); + //console.log(`Tarball Location : ${tarBallPath}`); - return tarBallPath; + //return tarBallPath; } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index bf5beb3..1d4895e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,7 +12,7 @@ async function run() { const owner = context.repo.owner const repo = context.repo.repo - const ref = context.repo.ref + const ref = context.ref console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);