From 4526e4a4b8d788a11e7bfca1abb6a862926a0b61 Mon Sep 17 00:00:00 2001 From: Jesse Turner Date: Thu, 28 May 2026 15:25:36 -0400 Subject: [PATCH 1/2] chore: remove sync-preview job from sync-from-public workflow Preview releases are now handled via preview-version.json on main using the Release Main and Preview workflow. The separate preview branch and its sync job are no longer needed. Confidence: high Scope-risk: narrow --- .github/workflows/sync-from-public.yml | 98 -------------------------- 1 file changed, 98 deletions(-) diff --git a/.github/workflows/sync-from-public.yml b/.github/workflows/sync-from-public.yml index 127257392..f35966afd 100644 --- a/.github/workflows/sync-from-public.yml +++ b/.github/workflows/sync-from-public.yml @@ -109,101 +109,3 @@ jobs: env: GH_TOKEN: ${{ steps.app-token.outputs.token }} - sync-preview: - runs-on: ubuntu-latest - steps: - - name: Generate GitHub App Token - id: app-token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ vars.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ steps.app-token.outputs.token }} - - - name: Configure Git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Fetch public preview - run: | - git remote add public https://github.com/aws/agentcore-cli.git - git fetch public preview - - - name: Sync preview with public/preview - run: | - git checkout -B preview origin/preview - - # Check if public/preview is already merged - if git merge-base --is-ancestor public/preview HEAD; then - echo "✅ preview is already up to date with public/preview" - exit 0 - fi - - # Merge but exclude .github/workflows/ (GITHUB_TOKEN lacks workflow permission) - if git merge public/preview --no-commit --no-ff; then - git checkout HEAD -- .github/workflows/ 2>/dev/null || true - git commit -m "chore: sync preview with public/preview" - git push origin preview - echo "✅ preview synced successfully" - else - echo "⚠️ Conflict detected in preview" - - # Capture conflicted files before aborting - conflicted_files=$(git diff --name-only --diff-filter=U 2>/dev/null || echo "Unable to determine conflicted files") - git merge --abort - - # Check if a sync PR already exists - existing_pr=$(gh pr list --base "preview" --search "Merge public/preview" --state open --json number --jq '.[0].number' 2>/dev/null || echo "") - - if [ -n "$existing_pr" ]; then - echo "ℹ️ PR #$existing_pr already exists, skipping" - exit 0 - fi - - conflict_branch="sync-conflict-preview-$(date +%Y%m%d-%H%M%S)" - git checkout -b "$conflict_branch" - - git merge public/preview --no-commit --no-ff || true - git checkout HEAD -- .github/workflows/ 2>/dev/null || true - git add -A - git commit -m "chore: sync preview with public/preview (conflicts present) - - This automated sync detected merge conflicts that require manual resolution. - - Source: public/preview (https://github.com/aws/agentcore-cli) - Target: preview - - Please resolve conflicts and merge this PR." || true - - git push origin "$conflict_branch" - - gh pr create \ - --title "🔀 [Sync Conflict] Merge public/preview → preview" \ - --body "## Automated Sync Conflict - - This PR was automatically created because merging \`public/preview\` into \`preview\` encountered conflicts. - - **Source:** \`preview\` from [aws/agentcore-cli](https://github.com/aws/agentcore-cli) - **Target:** \`preview\` - - ### Action Required - 1. \`git fetch origin && git checkout $conflict_branch\` - 2. Resolve merge conflicts - 3. \`git add . && git commit\` - 4. \`git push origin $conflict_branch\` - 5. Merge this PR - - ### Files with Conflicts - \`\`\` - $conflicted_files - \`\`\`" \ - --base "preview" \ - --head "$conflict_branch" || echo "⚠️ Failed to create PR" - fi - env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} From 052003dd7867f13999efa87248fa512e17655e41 Mon Sep 17 00:00:00 2001 From: Jesse Turner Date: Fri, 29 May 2026 09:38:42 -0400 Subject: [PATCH 2/2] chore: fix trailing newline in sync-from-public workflow --- .github/workflows/sync-from-public.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/sync-from-public.yml b/.github/workflows/sync-from-public.yml index f35966afd..a2ec14c0d 100644 --- a/.github/workflows/sync-from-public.yml +++ b/.github/workflows/sync-from-public.yml @@ -108,4 +108,3 @@ jobs: fi env: GH_TOKEN: ${{ steps.app-token.outputs.token }} -