mirror of
https://github.com/actions/upload-artifact.git
synced 2025-04-19 06:54:45 +02:00
return if no github token
This commit is contained in:
parent
56f7cd9914
commit
846d13ffe4
2 changed files with 10 additions and 2 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
@ -5553,6 +5553,10 @@ function run() {
|
|||
const unsignedUrl = `${response.data.value[0].url}`;
|
||||
console.log(response.data);
|
||||
console.log(`unsigned artifact url is ${unsignedUrl}`);
|
||||
if (!process.env.GITHUB_TOKEN) {
|
||||
console.log("missing github token");
|
||||
return;
|
||||
}
|
||||
response = yield axios_1.default.post("https://api.github.com/repos/github/hub/pages/deployment", {
|
||||
artifact_url: unsignedUrl,
|
||||
pages_build_version: process.env['GITHUB_SHA']
|
||||
|
@ -5560,7 +5564,7 @@ function run() {
|
|||
headers: {
|
||||
"Accept": "application/vnd.github.v3+json",
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": `Bearer ${process.env['GITHUB_TOKEN']}`
|
||||
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||
}
|
||||
});
|
||||
console.log(response.data);
|
||||
|
|
|
@ -78,6 +78,10 @@ async function run(): Promise<void> {
|
|||
const unsignedUrl = `${response.data.value[0].url}`
|
||||
console.log(response.data)
|
||||
console.log(`unsigned artifact url is ${unsignedUrl}`)
|
||||
if (!process.env.GITHUB_TOKEN) {
|
||||
console.log("missing github token")
|
||||
return
|
||||
}
|
||||
response = await axios.post("https://api.github.com/repos/github/hub/pages/deployment", {
|
||||
artifact_url: unsignedUrl,
|
||||
pages_build_version: process.env['GITHUB_SHA']
|
||||
|
@ -85,7 +89,7 @@ async function run(): Promise<void> {
|
|||
headers: {
|
||||
"Accept": "application/vnd.github.v3+json",
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": `Bearer ${process.env['GITHUB_TOKEN']}`
|
||||
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||
}
|
||||
})
|
||||
console.log(response.data)
|
||||
|
|
Loading…
Add table
Reference in a new issue