Skip to content

Commit c71fe13

Browse files
simplify: replace complex GitHub token generation with CODEBUFF_GITHUB_TOKEN
Replace generateGitHubToken() with simple checkGitHubToken() in release.js Remove complex JWT generation script (generate-github-token.ts) Use local CODEBUFF_GITHUB_TOKEN environment variable directly Update documentation to explain simplified release process Maintain backward compatibility by setting GITHUB_TOKEN for curl commands 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 6be2067 commit c71fe13

File tree

3 files changed

+18
-172
lines changed

3 files changed

+18
-172
lines changed

knowledge.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ Important constants are centralized in `common/src/constants.ts`:
300300

301301
This project uses [Infisical](https://infisical.com/) for secret management. All secrets are injected at runtime.
302302

303+
### Release Process
304+
305+
The release mechanism uses the `CODEBUFF_GITHUB_TOKEN` environment variable directly. The old complex GitHub App token generation system has been removed in favor of using a simple personal access token or the infisical-managed token.
306+
303307
**To run any service locally, use the `exec` runner script from root `package.json`**, which wraps commands with `infisical run --`.
304308

305309
Example: `bun run exec -- bun --cwd backend dev`

npm-app/scripts/generate-github-token.ts

Lines changed: 0 additions & 149 deletions
This file was deleted.

npm-app/scripts/release.js

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,18 @@ function formatTimestamp() {
2828
return now.toLocaleDateString('en-US', options)
2929
}
3030

31-
function generateGitHubToken() {
32-
try {
33-
// Run the generate-github-token script and capture its output
34-
const output = execSync('bun run scripts/generate-github-token.ts', {
35-
encoding: 'utf8',
36-
stdio: 'pipe', // Capture output instead of inheriting
37-
})
38-
39-
// Extract the token from the export command in the output
40-
const exportMatch = output.match(/export GITHUB_TOKEN="([^"]+)"/)
41-
if (exportMatch && exportMatch[1]) {
42-
const token = exportMatch[1]
43-
process.env.GITHUB_TOKEN = token
44-
return token
45-
} else {
46-
error(
47-
'Failed to extract GitHub token from generate-github-token script output',
48-
)
49-
}
50-
} catch (err) {
51-
error(`Failed to generate GitHub token: ${err.message}`)
31+
function checkGitHubToken() {
32+
const token = process.env.CODEBUFF_GITHUB_TOKEN
33+
if (!token) {
34+
error(
35+
'CODEBUFF_GITHUB_TOKEN environment variable is required but not set.\n' +
36+
'Please set it with your GitHub personal access token or use the infisical setup.'
37+
)
5238
}
39+
40+
// Set GITHUB_TOKEN for compatibility with existing curl commands
41+
process.env.GITHUB_TOKEN = token
42+
return token
5343
}
5444

5545
async function triggerWorkflow(versionType) {
@@ -93,8 +83,9 @@ async function main() {
9383
log('🚀 Initiating release...')
9484
log(`Date: ${formatTimestamp()}`)
9585

96-
// Generate GitHub token first
97-
generateGitHubToken()
86+
// Check for local GitHub token
87+
checkGitHubToken()
88+
log('✅ Using local CODEBUFF_GITHUB_TOKEN')
9889

9990
log(`Version bump type: ${versionType}`)
10091

0 commit comments

Comments
 (0)