Skip to content

Commit 33cfa5f

Browse files
authored
fix(github): github actions endpoint and auth (#358) thanks @meixg @henrycity
1 parent 8e73bed commit 33cfa5f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/lib/github-actions.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ async function createSecret(info) {
3535
const response = await request({
3636
method: 'GET',
3737
url: `${info.github.endpoint}/repos/${owner}/${repo}/actions/secrets/public-key`,
38-
auth: info.github,
38+
auth: {
39+
bearer: info.github.token,
40+
},
3941
headers: {'User-Agent': 'semantic-release', 'X-GitHub-OTP': info.github.code},
4042
});
4143
if (response.statusCode === 200) {
@@ -46,7 +48,9 @@ async function createSecret(info) {
4648
const responsePut = await request({
4749
method: 'PUT',
4850
url: `${info.github.endpoint}/repos/${owner}/${repo}/actions/secrets/NPM_TOKEN`,
49-
auth: info.github,
51+
auth: {
52+
bearer: info.github.token,
53+
},
5054
headers: {'User-Agent': 'semantic-release', 'X-GitHub-OTP': info.github.code},
5155
json: true,
5256
body: {

src/lib/github.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ module.exports = async function (info) {
3535
if (!token) throw new Error('User could not supply GitHub Personal Access Token.');
3636

3737
info.github.token = token;
38+
info.github.endpoint = 'https://api.github.com';
3839
log.info('Successfully created GitHub token.');
3940
};

0 commit comments

Comments
 (0)