@@ -24,7 +24,10 @@ import { execSync } from 'child_process'
24
24
const authHeader = `AUTHORIZATION: basic ${ Buffer . from ( `x-access-token:${ process . env . RELEASE_GITHUB_TOKEN } ` ) . toString ( 'base64' ) } `
25
25
execSync ( `git config --local http.https://github.com/.extraheader "${ authHeader } "` )
26
26
27
- // [Your code for changelog/tagging or npm publish goes here...]
27
+ // ---- RELEASE LOGIC ----
28
+ // Insert your release logic here (e.g. changelog, tagging, npm publish, etc.)
29
+ // Example:
30
+ // execSync('npm run release-build-or-tag-step-here')
28
31
29
32
// Restore the header (if it existed) and GH token
30
33
if ( originalAuth ) {
@@ -39,9 +42,6 @@ import { execSync } from 'child_process'
39
42
process . env . GITHUB_TOKEN = process . env . RELEASE_GITHUB_TOKEN
40
43
41
44
// Remove ALL credential helpers to ensure only our token is used
42
- try {
43
- execSync ( 'git config --system --unset credential.helper || true' )
44
- } catch { }
45
45
try {
46
46
execSync ( 'git config --global --unset credential.helper || true' )
47
47
} catch { }
@@ -55,11 +55,12 @@ import { execSync } from 'child_process'
55
55
execSync ( `git remote set-url origin "${ remoteUrl } "` )
56
56
}
57
57
58
- const branchName = `release-test`
58
+ // Use a descriptive branch name for the release
59
+ const branchName = `test-pr-create`
59
60
60
61
try {
61
62
execSync ( `git checkout -b ${ branchName } ` )
62
- // create a small file and git add it
63
+ // create a small file and git add it (replace with actual release changes)
63
64
execSync ( 'touch test.txt' )
64
65
execSync ( 'git add test.txt' )
65
66
@@ -74,13 +75,14 @@ import { execSync } from 'child_process'
74
75
75
76
// Open PR using GitHub CLI (GH_TOKEN is automatically picked up in CI)
76
77
execSync (
77
- `gh pr create --base master --head ${ branchName } --title "chore(repo): test permissions " --body "chore(repo): test permissions "` ,
78
+ `gh pr create --base master --head ${ branchName } --title "chore(repo): automated release " --body "Automated release PR from script "` ,
78
79
{ stdio : 'inherit' }
79
80
)
80
81
81
- // Enable auto-merge
82
+ // Enable auto-merge (optional, remove if you want manual review)
82
83
execSync ( `gh pr merge --auto --squash` , { stdio : 'inherit' } )
83
84
} catch ( err ) {
84
85
console . error ( '❌ Failed to push release branch or open PR' , err )
86
+ process . exit ( 1 )
85
87
}
86
88
} ) ( )
0 commit comments