keep going (#8881)

Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
This commit is contained in:
matt korwel
2025-09-19 01:16:37 -07:00
committed by GitHub
parent bba0f2e557
commit 44805f4d58
2 changed files with 16 additions and 34 deletions

View File

@@ -68,64 +68,44 @@ jobs:
# Configure git to use GITHUB_TOKEN for remote operations (has actions:write for workflow files) # Configure git to use GITHUB_TOKEN for remote operations (has actions:write for workflow files)
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
- name: 'Create Branches' - name: 'Create Patch'
id: 'create_branches' id: 'create_patch'
env: env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
continue-on-error: true
run: |
# Capture output and display it in logs using tee
{
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
echo "BRANCH_EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
} 2>&1 | tee >(
echo "BRANCH_LOG_CONTENT<<EOF" >> "$GITHUB_ENV"
cat >> "$GITHUB_ENV"
echo "EOF" >> "$GITHUB_ENV"
)
- name: 'Create Pull Request'
id: 'create_pr'
if: 'always() && steps.create_branches.outputs.BRANCH_EXIT_CODE == 0'
env:
GH_TOKEN: '${{ steps.generate_token.outputs.token }}' GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
continue-on-error: true continue-on-error: true
run: | run: |
# Capture output and display it in logs using tee # Capture output and display it in logs using tee
{ {
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 node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }}
echo "PR_EXIT_CODE=$?" >> "$GITHUB_OUTPUT" EXIT_CODE=$?
echo "EXIT_CODE=$EXIT_CODE" >> "$GITHUB_OUTPUT"
exit $EXIT_CODE
} 2>&1 | tee >( } 2>&1 | tee >(
echo "PR_LOG_CONTENT<<EOF" >> "$GITHUB_ENV" echo "LOG_CONTENT<<EOF" >> "$GITHUB_ENV"
cat >> "$GITHUB_ENV" cat >> "$GITHUB_ENV"
echo "EOF" >> "$GITHUB_ENV" echo "EOF" >> "$GITHUB_ENV"
) )
- name: 'Comment on Original PR' - name: 'Comment on Original PR'
if: 'always() && inputs.original_pr' if: 'always() && github.event.inputs.original_pr'
env: env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
ORIGINAL_PR: '${{ github.event.inputs.original_pr }}' ORIGINAL_PR: '${{ github.event.inputs.original_pr }}'
EXIT_CODE: '${{ steps.create_branches.outputs.BRANCH_EXIT_CODE != 0 && steps.create_branches.outputs.BRANCH_EXIT_CODE || steps.create_pr.outputs.PR_EXIT_CODE }}' EXIT_CODE: '${{ steps.create_patch.outputs.EXIT_CODE }}'
COMMIT: '${{ github.event.inputs.commit }}' COMMIT: '${{ github.event.inputs.commit }}'
CHANNEL: '${{ github.event.inputs.channel }}' CHANNEL: '${{ github.event.inputs.channel }}'
REPOSITORY: '${{ github.repository }}' REPOSITORY: '${{ github.repository }}'
GITHUB_RUN_ID: '${{ github.run_id }}' GITHUB_RUN_ID: '${{ github.run_id }}'
LOG_CONTENT: '${{ steps.create_branches.outputs.BRANCH_EXIT_CODE != 0 && env.BRANCH_LOG_CONTENT || env.PR_LOG_CONTENT }}' LOG_CONTENT: '${{ env.LOG_CONTENT }}'
continue-on-error: true continue-on-error: true
run: | run: |
git checkout '${{ github.event.inputs.ref }}' git checkout '${{ github.event.inputs.ref }}'
node scripts/releasing/patch-create-comment.js node scripts/releasing/patch-create-comment.js
- name: 'Fail Workflow if Tasks Failed' - name: 'Fail Workflow if Main Task Failed'
if: 'always() && (steps.create_branches.outputs.BRANCH_EXIT_CODE != 0 || steps.create_pr.outputs.PR_EXIT_CODE != 0)' if: 'always() && steps.create_patch.outputs.EXIT_CODE != 0'
run: | run: |
if [[ "${{ steps.create_branches.outputs.BRANCH_EXIT_CODE }}" != "0" ]]; then echo "Patch creation failed with exit code: ${{ steps.create_patch.outputs.EXIT_CODE }}"
echo "Branch creation failed with exit code: ${{ steps.create_branches.outputs.BRANCH_EXIT_CODE }}"
fi
if [[ "${{ steps.create_pr.outputs.PR_EXIT_CODE }}" != "0" ]]; then
echo "PR creation failed with exit code: ${{ steps.create_pr.outputs.PR_EXIT_CODE }}"
fi
echo "Check the logs above and the comment posted to the original PR for details." echo "Check the logs above and the comment posted to the original PR for details."
exit 1 exit 1

View File

@@ -95,7 +95,9 @@ async function main() {
console.log( console.log(
`Release branch ${releaseBranch} does not exist. Creating it from tag ${latestTag}...`, `Release branch ${releaseBranch} does not exist. Creating it from tag ${latestTag}...`,
); );
run(`git checkout -b ${releaseBranch} ${latestTag}`, dryRun); // Workaround for workflow permission issues: create branch from HEAD then reset to tag
run(`git checkout -b ${releaseBranch}`, dryRun);
run(`git reset --hard ${latestTag}`, dryRun);
run(`git push origin ${releaseBranch}`, dryRun); run(`git push origin ${releaseBranch}`, dryRun);
} else { } else {
console.log(`Release branch ${releaseBranch} already exists.`); console.log(`Release branch ${releaseBranch} already exists.`);