diff --git a/.github/workflows/update-cli-coverage.yml b/.github/workflows/update-cli-coverage.yml index e76ecb1..3cf8413 100644 --- a/.github/workflows/update-cli-coverage.yml +++ b/.github/workflows/update-cli-coverage.yml @@ -93,19 +93,16 @@ jobs: run: | gh repo clone kernel/kernel /tmp/kernel-api -- --depth=1 - - name: Clone CLI repo and checkout existing branch + - name: Clone CLI repo env: GH_TOKEN: ${{ steps.app-token.outputs.token }} run: | gh repo clone kernel/cli /tmp/kernel-cli cd /tmp/kernel-cli - # Check if the cli-coverage-update branch already exists on remote - if git ls-remote --exit-code --heads origin cli-coverage-update >/dev/null 2>&1; then + if git fetch origin cli-coverage-update 2>/dev/null; then echo "Branch cli-coverage-update exists, checking it out..." - git fetch origin cli-coverage-update git checkout cli-coverage-update - # Merge latest main to keep it up to date git merge origin/main -m "Merge main into cli-coverage-update" --no-edit || true else echo "Branch cli-coverage-update does not exist, will create from main" @@ -290,10 +287,10 @@ jobs: # Output Format After pushing changes, create or update an evergreen PR using gh: - 1. Check if a PR already exists for the cli-coverage-update branch: - gh pr list --repo kernel/cli --head cli-coverage-update --json number + 1. Check if an open PR already exists for the cli-coverage-update branch: + gh pr list --repo kernel/cli --head cli-coverage-update --state open --json number - 2. If PR exists, update it. If not, create a new one. + 2. If an open PR exists, update it. If not, create a new one. If new commands or flags were added: Title: 'CLI: Update SDK to and add new commands/flags'