Skip to content

Commit 193c0fb

Browse files
committed
fix(ci): move snapshot update after build and use SYNC_PAT for sync-preview
Two fixes: 1. release-main-and-preview.yml: move `npm run test:update-snapshots` to after `npm run build` so tests have built artifacts available. Previously it ran inside the CDK sync step before the build, causing 18 test failures. 2. sync-preview.yml: use SYNC_PAT to bypass branch protection on preview branch. Direct pushes were failing with GH013 rule violation.
1 parent 061b6b3 commit 193c0fb

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/release-main-and-preview.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ jobs:
120120
fs.writeFileSync('$TEMPLATE_PKG', JSON.stringify(pkg, null, 2) + '\n');
121121
"
122122
echo "✅ Updated @aws/agentcore-cdk: $CURRENT_CDK -> $LATEST_CDK"
123-
npm run test:update-snapshots
124123
fi
125124
fi
126125
@@ -147,6 +146,9 @@ jobs:
147146
node scripts/generate-schema.mjs
148147
npx prettier --write schemas/
149148
149+
- name: Update snapshots
150+
run: npm run test:update-snapshots
151+
150152
- name: Create release branch and PR
151153
env:
152154
GH_TOKEN: ${{ github.token }}
@@ -219,7 +221,6 @@ jobs:
219221
fs.writeFileSync('$TEMPLATE_PKG', JSON.stringify(pkg, null, 2) + '\n');
220222
"
221223
echo "✅ Updated @aws/agentcore-cdk: $CURRENT_CDK -> $LATEST_CDK"
222-
npm run test:update-snapshots
223224
fi
224225
fi
225226
@@ -245,6 +246,9 @@ jobs:
245246
node scripts/generate-schema.mjs
246247
npx prettier --write schemas/
247248
249+
- name: Update snapshots
250+
run: npm run test:update-snapshots
251+
248252
- name: Create release branch and PR
249253
env:
250254
GH_TOKEN: ${{ github.token }}

.github/workflows/sync-preview.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
with:
2323
ref: preview
2424
fetch-depth: 0
25+
token: ${{ secrets.SYNC_PAT }}
2526

2627
- name: Configure git
2728
run: |
@@ -70,7 +71,7 @@ jobs:
7071
- name: Create PR for conflict resolution
7172
if: steps.merge.outputs.status == 'conflict'
7273
env:
73-
GH_TOKEN: ${{ github.token }}
74+
GH_TOKEN: ${{ secrets.SYNC_PAT }}
7475
AUTHOR_NAME: ${{ steps.author.outputs.name }}
7576
AUTHOR_GH: ${{ steps.author.outputs.gh_user }}
7677
run: |

0 commit comments

Comments
 (0)