mirror of
https://github.com/naveenrajm7/rpmbuild.git
synced 2025-07-14 04:53:51 +00:00
using ref and promise data
This commit is contained in:
@ -16,16 +16,18 @@ function download_archive(owner, repo, ref) {
|
|||||||
try {
|
try {
|
||||||
const octokit = new Octokit();
|
const octokit = new Octokit();
|
||||||
const archive_format = "tarball";
|
const archive_format = "tarball";
|
||||||
const downloadLocation = octokit.repos.getArchiveLink({
|
octokit.repos.getArchiveLink({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
archive_format,
|
archive_format,
|
||||||
ref
|
ref
|
||||||
|
}).then(({ data }) => {
|
||||||
|
console.log(data);
|
||||||
});
|
});
|
||||||
console.log(`Download Location : ${downloadLocation}`);
|
//console.log(`Download Location : ${downloadLocation}`);
|
||||||
const tarBallPath = yield 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) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
@ -20,7 +20,7 @@ function run() {
|
|||||||
const context = github.context;
|
const context = github.context;
|
||||||
const owner = context.repo.owner;
|
const owner = context.repo.owner;
|
||||||
const repo = context.repo.repo;
|
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}`);
|
console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);
|
||||||
const tarBallPath = download_tar(owner, repo, ref);
|
const tarBallPath = download_tar(owner, repo, ref);
|
||||||
console.log(`Tar Path for copy : ${tarBallPath}`);
|
console.log(`Tar Path for copy : ${tarBallPath}`);
|
||||||
|
@ -10,20 +10,22 @@ async function download_archive(owner, repo, ref ) {
|
|||||||
|
|
||||||
const archive_format = "tarball";
|
const archive_format = "tarball";
|
||||||
|
|
||||||
const downloadLocation = octokit.repos.getArchiveLink({
|
octokit.repos.getArchiveLink({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
archive_format,
|
archive_format,
|
||||||
ref
|
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) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
@ -12,7 +12,7 @@ async function run() {
|
|||||||
|
|
||||||
const owner = context.repo.owner
|
const owner = context.repo.owner
|
||||||
const repo = context.repo.repo
|
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}`);
|
console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user