Update github release script.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
pull/239/head
Jerome Luckenbach 2021-02-28 20:30:52 +01:00
parent 91d0744cb9
commit 3e37b5e89a
3 changed files with 26 additions and 3 deletions

View File

@ -1,4 +1,6 @@
const { Octokit } = require('@octokit/rest')
const { createActionAuth } = require("@octokit/auth-action");
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const fs = require('fs');
@ -19,15 +21,16 @@ This is intended to be run by the release pipeline only.`);
process.exit(1);
}
const auth = createActionAuth();
const authentication = await auth();
async function createRelease() {
const octokit = new Octokit({
auth: token
auth: authentication.token
});
console.log('Starting release creation.');
console.log(octokit);
let target_commitish;
if (process.env.BUILD_SOURCEBRANCH) {
target_commitish = process.env.BUILD_SOURCEBRANCH;

View File

@ -8,9 +8,19 @@
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"@octokit/auth-action": "^1.3.2",
"@octokit/rest": "^18.3.0"
}
},
"node_modules/@octokit/auth-action": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/@octokit/auth-action/-/auth-action-1.3.2.tgz",
"integrity": "sha512-eCFGNq30e8ObTh6fwcmq8JRaGoputPQtPi9PTgbsEo+NPd5JrOoynI2bV7OpePRqgtATp1JRWC0y/3iXTB11ow==",
"dependencies": {
"@octokit/auth-token": "^2.4.0",
"@octokit/types": "^6.0.3"
}
},
"node_modules/@octokit/auth-token": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz",
@ -178,6 +188,15 @@
}
},
"dependencies": {
"@octokit/auth-action": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/@octokit/auth-action/-/auth-action-1.3.2.tgz",
"integrity": "sha512-eCFGNq30e8ObTh6fwcmq8JRaGoputPQtPi9PTgbsEo+NPd5JrOoynI2bV7OpePRqgtATp1JRWC0y/3iXTB11ow==",
"requires": {
"@octokit/auth-token": "^2.4.0",
"@octokit/types": "^6.0.3"
}
},
"@octokit/auth-token": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz",

View File

@ -9,6 +9,7 @@
"author": "Microsoft",
"license": "MIT",
"dependencies": {
"@octokit/auth-action": "^1.3.2",
"@octokit/rest": "^18.3.0"
}
}