mirror of
https://github.com/softprops/action-gh-release.git
synced 2024-12-02 12:23:09 +03:00
try try try again
This commit is contained in:
parent
cf2aed3a12
commit
e197e56931
@ -49,19 +49,25 @@ exports.release = (config, gh) => __awaiter(void 0, void 0, void 0, function* ()
|
|||||||
catch (error) {
|
catch (error) {
|
||||||
if (error.status === 404) {
|
if (error.status === 404) {
|
||||||
console.log("Creating new release...");
|
console.log("Creating new release...");
|
||||||
const tag_name = config.github_ref.replace("refs/tags/", "");
|
try {
|
||||||
const name = config.input_name || tag_name;
|
const tag_name = config.github_ref.replace("refs/tags/", "");
|
||||||
const body = config.input_body;
|
const name = config.input_name || tag_name;
|
||||||
const draft = config.input_draft;
|
const body = config.input_body;
|
||||||
let release = yield gh.repos.createRelease({
|
const draft = config.input_draft;
|
||||||
owner,
|
let release = yield gh.repos.createRelease({
|
||||||
repo,
|
owner,
|
||||||
tag_name,
|
repo,
|
||||||
name,
|
tag_name,
|
||||||
body,
|
name,
|
||||||
draft
|
body,
|
||||||
});
|
draft
|
||||||
return release.data;
|
});
|
||||||
|
return release.data;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.log(`created failed with status: ${error.status}`);
|
||||||
|
return exports.release(config, gh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log(`Unexpected error fetching github release for tag ${config.github_ref}: ${error}`);
|
console.log(`Unexpected error fetching github release for tag ${config.github_ref}: ${error}`);
|
||||||
|
@ -67,19 +67,24 @@ export const release = async (
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.status === 404) {
|
if (error.status === 404) {
|
||||||
console.log("Creating new release...");
|
console.log("Creating new release...");
|
||||||
const tag_name = config.github_ref.replace("refs/tags/", "");
|
try {
|
||||||
const name = config.input_name || tag_name;
|
const tag_name = config.github_ref.replace("refs/tags/", "");
|
||||||
const body = config.input_body;
|
const name = config.input_name || tag_name;
|
||||||
const draft = config.input_draft;
|
const body = config.input_body;
|
||||||
let release = await gh.repos.createRelease({
|
const draft = config.input_draft;
|
||||||
owner,
|
let release = await gh.repos.createRelease({
|
||||||
repo,
|
owner,
|
||||||
tag_name,
|
repo,
|
||||||
name,
|
tag_name,
|
||||||
body,
|
name,
|
||||||
draft
|
body,
|
||||||
});
|
draft
|
||||||
return release.data;
|
});
|
||||||
|
return release.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(`created failed with status: ${error.status}`);
|
||||||
|
return release(config, gh);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(`Unexpected error fetching github release for tag ${config.github_ref}: ${error}`);
|
console.log(`Unexpected error fetching github release for tag ${config.github_ref}: ${error}`);
|
||||||
throw error;
|
throw error;
|
||||||
|
Loading…
Reference in New Issue
Block a user