Skip to content

Commit 44805f4

Browse files
keep going (#8881)
Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
1 parent bba0f2e commit 44805f4

2 files changed

Lines changed: 16 additions & 34 deletions

File tree

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

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -68,64 +68,44 @@ jobs:
6868
# Configure git to use GITHUB_TOKEN for remote operations (has actions:write for workflow files)
6969
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
7070
71-
- name: 'Create Branches'
72-
id: 'create_branches'
71+
- name: 'Create Patch'
72+
id: 'create_patch'
7373
env:
7474
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
75-
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
76-
continue-on-error: true
77-
run: |
78-
# Capture output and display it in logs using tee
79-
{
80-
node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }} --skip-pr-creation
81-
echo "BRANCH_EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
82-
} 2>&1 | tee >(
83-
echo "BRANCH_LOG_CONTENT<<EOF" >> "$GITHUB_ENV"
84-
cat >> "$GITHUB_ENV"
85-
echo "EOF" >> "$GITHUB_ENV"
86-
)
87-
88-
- name: 'Create Pull Request'
89-
id: 'create_pr'
90-
if: 'always() && steps.create_branches.outputs.BRANCH_EXIT_CODE == 0'
91-
env:
9275
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
9376
continue-on-error: true
9477
run: |
9578
# Capture output and display it in logs using tee
9679
{
97-
node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }} --pr-only
98-
echo "PR_EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
80+
node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }}
81+
EXIT_CODE=$?
82+
echo "EXIT_CODE=$EXIT_CODE" >> "$GITHUB_OUTPUT"
83+
exit $EXIT_CODE
9984
} 2>&1 | tee >(
100-
echo "PR_LOG_CONTENT<<EOF" >> "$GITHUB_ENV"
85+
echo "LOG_CONTENT<<EOF" >> "$GITHUB_ENV"
10186
cat >> "$GITHUB_ENV"
10287
echo "EOF" >> "$GITHUB_ENV"
10388
)
10489
10590
- name: 'Comment on Original PR'
106-
if: 'always() && inputs.original_pr'
91+
if: 'always() && github.event.inputs.original_pr'
10792
env:
10893
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
10994
ORIGINAL_PR: '${{ github.event.inputs.original_pr }}'
110-
EXIT_CODE: '${{ steps.create_branches.outputs.BRANCH_EXIT_CODE != 0 && steps.create_branches.outputs.BRANCH_EXIT_CODE || steps.create_pr.outputs.PR_EXIT_CODE }}'
95+
EXIT_CODE: '${{ steps.create_patch.outputs.EXIT_CODE }}'
11196
COMMIT: '${{ github.event.inputs.commit }}'
11297
CHANNEL: '${{ github.event.inputs.channel }}'
11398
REPOSITORY: '${{ github.repository }}'
11499
GITHUB_RUN_ID: '${{ github.run_id }}'
115-
LOG_CONTENT: '${{ steps.create_branches.outputs.BRANCH_EXIT_CODE != 0 && env.BRANCH_LOG_CONTENT || env.PR_LOG_CONTENT }}'
100+
LOG_CONTENT: '${{ env.LOG_CONTENT }}'
116101
continue-on-error: true
117102
run: |
118103
git checkout '${{ github.event.inputs.ref }}'
119104
node scripts/releasing/patch-create-comment.js
120105
121-
- name: 'Fail Workflow if Tasks Failed'
122-
if: 'always() && (steps.create_branches.outputs.BRANCH_EXIT_CODE != 0 || steps.create_pr.outputs.PR_EXIT_CODE != 0)'
106+
- name: 'Fail Workflow if Main Task Failed'
107+
if: 'always() && steps.create_patch.outputs.EXIT_CODE != 0'
123108
run: |
124-
if [[ "${{ steps.create_branches.outputs.BRANCH_EXIT_CODE }}" != "0" ]]; then
125-
echo "Branch creation failed with exit code: ${{ steps.create_branches.outputs.BRANCH_EXIT_CODE }}"
126-
fi
127-
if [[ "${{ steps.create_pr.outputs.PR_EXIT_CODE }}" != "0" ]]; then
128-
echo "PR creation failed with exit code: ${{ steps.create_pr.outputs.PR_EXIT_CODE }}"
129-
fi
109+
echo "Patch creation failed with exit code: ${{ steps.create_patch.outputs.EXIT_CODE }}"
130110
echo "Check the logs above and the comment posted to the original PR for details."
131111
exit 1

scripts/releasing/create-patch-pr.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ async function main() {
9595
console.log(
9696
`Release branch ${releaseBranch} does not exist. Creating it from tag ${latestTag}...`,
9797
);
98-
run(`git checkout -b ${releaseBranch} ${latestTag}`, dryRun);
98+
// Workaround for workflow permission issues: create branch from HEAD then reset to tag
99+
run(`git checkout -b ${releaseBranch}`, dryRun);
100+
run(`git reset --hard ${latestTag}`, dryRun);
99101
run(`git push origin ${releaseBranch}`, dryRun);
100102
} else {
101103
console.log(`Release branch ${releaseBranch} already exists.`);

0 commit comments

Comments
 (0)