File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,21 +39,15 @@ jobs:
3939 git commit -m "chore: update GitHub CLI version to ${{ env.LATEST_VERSION }}"
4040 git push origin update-gh-cli-version-${{ env.LATEST_VERSION }}
4141
42- # Create PR and capture the PR number
43- PR_NUMBER =$(gh pr create \
42+ # Create PR first
43+ PR_URL =$(gh pr create \
4444 --title "chore: update GitHub CLI version to ${{ env.LATEST_VERSION }}" \
4545 --body "Automated PR to update GitHub CLI version from $CURRENT_VERSION to ${{ env.LATEST_VERSION }}" \
4646 --base main \
47- --head update-gh-cli-version-${{ env.LATEST_VERSION }} \
48- --json number -q .number)
47+ --head update-gh-cli-version-${{ env.LATEST_VERSION }})
4948
50- # Enable auto-merge with error handling
51- if gh pr merge $PR_NUMBER --auto --delete-branch --squash; then
52- echo "Auto-merge enabled successfully"
53- else
54- echo "Failed to enable auto-merge, but PR was created"
55- exit 0 # Don't fail the workflow just because auto-merge couldn't be enabled
56- fi
49+ # Enable auto-merge on the created PR
50+ gh pr merge --auto --delete-branch --squash "$PR_URL"
5751 else
5852 echo "Already using the latest version ($CURRENT_VERSION)"
5953 fi
You can’t perform that action at this time.
0 commit comments