Skip to content

Commit

Permalink
πŸ’š fix CI PR comment (#3250)
Browse files Browse the repository at this point in the history
* πŸ’š fix CI PR comment

* Fix GITHUB_TOKEN access

---------

Co-authored-by: Aymeric Mortemousque <[email protected]>
  • Loading branch information
BenoitZugmeyer and amortemousque authored Jan 6, 2025
1 parent 6fb4e3c commit 21975c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/deploy/deploy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { printLog, runMain } = require('../lib/executionUtils')
const { fetchPR, getLocalBranch } = require('../lib/gitUtils')
const { fetchPR, LOCAL_BRANCH } = require('../lib/gitUtils')
const { command } = require('../lib/command')

const {
Expand Down Expand Up @@ -50,7 +50,7 @@ async function main(env, version, uploadPathTypes) {
for (const uploadPathType of uploadPathTypes) {
let uploadPath
if (uploadPathType === 'pull-request') {
const pr = await fetchPR(getLocalBranch())
const pr = await fetchPR(LOCAL_BRANCH)
if (!pr) {
console.log('No pull requests found for the branch')
return
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/gitUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ module.exports = {
initGitConfig,
fetchPR,
getLastCommonCommit,
getLocalBranch: () => process.env.CI_COMMIT_REF_NAME,
LOCAL_BRANCH: process.env.CI_COMMIT_REF_NAME,
}
5 changes: 3 additions & 2 deletions scripts/performance/lib/reportAsAPrComment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { command } = require('../../lib/command')
const { fetchHandlingError } = require('../../lib/executionUtils')
const { LOCAL_BRANCH, GITHUB_TOKEN, getLastCommonCommit, fetchPR } = require('../../lib/gitUtils')
const { LOCAL_BRANCH, getLastCommonCommit, fetchPR } = require('../../lib/gitUtils')
const { getGithubAccessToken } = require('../../lib/secrets')
const { fetchPerformanceMetrics } = require('./fetchPerformanceMetrics')
const PR_COMMENT_HEADER = 'Bundles Sizes Evolution'
const PR_COMMENTER_AUTH_TOKEN = command`authanywhere --raw`.run()
Expand Down Expand Up @@ -74,7 +75,7 @@ async function retrieveExistingCommentId(prNumber) {
{
method: 'GET',
headers: {
Authorization: `token ${GITHUB_TOKEN}`,
Authorization: `token ${getGithubAccessToken()}`,
},
}
)
Expand Down

0 comments on commit 21975c7

Please sign in to comment.