mirror of
https://github.com/naveenrajm7/rpmbuild.git
synced 2025-07-12 04:13:50 +00:00
using ref and promise data
This commit is contained in:
@ -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);
|
||||
|
@ -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}`);
|
||||
|
@ -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);
|
||||
|
@ -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}`);
|
||||
|
||||
|
Reference in New Issue
Block a user