Skip to content

Commit 47a8bd6

Browse files
debugging
1 parent 44805f4 commit 47a8bd6

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/release-patch-1-create-pr.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
contents: 'write'
3737
pull-requests: 'write'
3838
actions: 'write'
39+
workflows: 'write'
3940
steps:
4041
- name: 'Checkout'
4142
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
@@ -52,14 +53,6 @@ jobs:
5253
- name: 'Install Script Dependencies'
5354
run: 'npm install yargs'
5455

55-
- name: 'Generate GitHub App Token'
56-
id: 'generate_token'
57-
uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b'
58-
with:
59-
app-id: '${{ secrets.APP_ID }}'
60-
private-key: '${{ secrets.PRIVATE_KEY }}'
61-
permission-pull-requests: 'write'
62-
permission-contents: 'write'
6356

6457
- name: 'Configure Git User'
6558
run: |-
@@ -72,7 +65,7 @@ jobs:
7265
id: 'create_patch'
7366
env:
7467
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
75-
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
68+
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
7669
continue-on-error: true
7770
run: |
7871
# Capture output and display it in logs using tee

scripts/releasing/create-patch-pr.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ async function main() {
9898
// Workaround for workflow permission issues: create branch from HEAD then reset to tag
9999
run(`git checkout -b ${releaseBranch}`, dryRun);
100100
run(`git reset --hard ${latestTag}`, dryRun);
101+
102+
// Ensure we're using GITHUB_TOKEN (with actions:write) for pushing workflow files
103+
const githubToken = process.env.GITHUB_TOKEN;
104+
const repo = process.env.GITHUB_REPOSITORY || 'google-gemini/gemini-cli';
105+
if (githubToken) {
106+
run(`git remote set-url origin https://x-access-token:${githubToken}@github.com/${repo}.git`, dryRun);
107+
}
108+
101109
run(`git push origin ${releaseBranch}`, dryRun);
102110
} else {
103111
console.log(`Release branch ${releaseBranch} already exists.`);

0 commit comments

Comments
 (0)