mirror of
https://gitea.com/actions/upload-artifact.git
synced 2025-09-18 09:38:34 +08:00
return if no github token
This commit is contained in:
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);
|
||||
|
Reference in New Issue
Block a user