Skip to content

Commit 467964d

Browse files
authored
chore(ci): strip old branch names from workflows (#2778)
* chore(ci): strip old branch names from workflows * fix(ci): use CDK v0.x for CLI prerelease and bundling
1 parent 7a2bcde commit 467964d

8 files changed

Lines changed: 24 additions & 22 deletions

File tree

‎.github/workflows/canary-refactor.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
uses: ./.github/workflows/refactor-e2e.yml
5858
with:
5959
artifactRef: ${{ needs.resolve_release.outputs.ref }}
60-
testRef: refactor
60+
testRef: v1.x
6161
tags: canary
6262
linuxOnly: true
6363
secrets:

‎.github/workflows/codeql.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CodeQL
22

33
on:
44
push:
5-
branches: ['v0.x', 'refactor']
5+
branches: ['v0.x', 'v1.x']
66
pull_request:
7-
branches: ['v0.x', 'refactor', 'feat/**']
7+
branches: ['v0.x', 'v1.x', 'feat/**']
88

99
# Cancel in-progress runs for PRs; never cancel runs on v0.x (merges should not abort each other)
1010
concurrency:

‎.github/workflows/e2e-tests-full.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
default: 'us-east-1'
88
cdk_branch:
99
description: 'Branch of CDK constructs repo to build from'
10-
default: 'main'
10+
default: 'v0.x'
1111
push:
1212
branches: [v0.x, 'feat/**']
1313

@@ -92,17 +92,17 @@ jobs:
9292
skip-token-revoke: true
9393
- name: Clone CDK repository
9494
run: |
95-
if [ -n "${{ inputs.cdk_branch }}" ] && [ "${{ inputs.cdk_branch }}" != "main" ]; then
95+
if [ -n "${{ inputs.cdk_branch }}" ] && [ "${{ inputs.cdk_branch }}" != "v0.x" ]; then
9696
CDK_BRANCH="${{ inputs.cdk_branch }}"
9797
elif [ "${{ github.ref_name }}" != "v0.x" ]; then
98-
CDK_BRANCH="main"
98+
CDK_BRANCH="v0.x"
9999
REPO_URL="https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git"
100100
# Check if a branch exists on the CDK repo with the same name
101101
if git ls-remote --exit-code --heads "$REPO_URL" "${{ github.ref_name }}" > /dev/null 2>&1; then
102102
CDK_BRANCH="${{ github.ref_name }}"
103103
fi
104104
else
105-
CDK_BRANCH="main"
105+
CDK_BRANCH="v0.x"
106106
fi
107107
echo "Using CDK branch: $CDK_BRANCH"
108108
git clone --depth 1 --branch "$CDK_BRANCH" "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo

‎.github/workflows/e2e-tests.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
description: 'AWS region for deployment'
77
default: 'us-east-1'
88
cdk_branch:
9-
description: 'CDK repo branch to build from (default: main)'
10-
default: 'main'
9+
description: 'CDK repo branch to build from (default: v0.x)'
10+
default: 'v0.x'
1111
pull_request_target:
1212
branches: [v0.x, feat/**]
1313
# Skip E2E on changes that can't affect agent behavior (e.g. docs-only PRs).
@@ -167,7 +167,7 @@ jobs:
167167
# Clone CDK repo for bundle script (requires App token for private repo access)
168168
- name: Clone CDK repo
169169
run: |
170-
CDK_BRANCH="${INPUT_CDK_BRANCH:-main}"
170+
CDK_BRANCH="${INPUT_CDK_BRANCH:-v0.x}"
171171
echo "Cloning CDK from branch: $CDK_BRANCH"
172172
git clone --depth 1 --branch "$CDK_BRANCH" "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo
173173
git -C /tmp/cdk-repo remote remove origin

‎.github/workflows/pr-automation.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PR Automation
22

33
on:
44
pull_request_target:
5-
branches: [v0.x, refactor, 'feat/**']
5+
branches: [v0.x, v1.x, 'feat/**']
66
types: [opened, reopened, edited, synchronize, labeled]
77
workflow_dispatch:
88
inputs:
@@ -46,7 +46,7 @@ jobs:
4646
with:
4747
runner: codebuild
4848
pr_number: ${{ inputs.pr_number || format('{0}', github.event.pull_request.number) }}
49-
allowed_base_branches: '["v0.x","refactor"]'
49+
allowed_base_branches: '["v0.x","v1.x"]'
5050
secrets: inherit
5151

5252
harness-review:

‎.github/workflows/prerelease-tarball.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
owner: aws
3636
- name: Clone CDK repo
3737
run: |
38-
git clone --depth 1 "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo
38+
git clone --depth 1 --branch v0.x "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo
3939
env:
4040
CDK_REPO_TOKEN: ${{ steps.app-token.outputs.token }}
4141
CDK_REPO: ${{ secrets.CDK_REPO_NAME }}

‎.github/workflows/refactor-e2e.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ on:
3030
artifactRef:
3131
description: git reference (commit, branch, or tag) to build the CLI from
3232
type: string
33-
default: refactor
33+
default: v1.x
3434
testRef:
3535
description: git reference (commit, branch, or tag) to run E2E tests from, defaults to artifactRef
3636
type: string
@@ -46,8 +46,8 @@ on:
4646

4747
concurrency:
4848
group:
49-
e2e-test-${{ inputs.artifactRef || 'refactor' }}-${{ inputs.testRef || inputs.artifactRef || 'refactor' }}-${{
50-
inputs.tags || 'all' }}-${{ inputs.linuxOnly && 'linux-only' || 'all-os' }}
49+
e2e-test-${{ inputs.artifactRef || 'v1.x' }}-${{ inputs.testRef || inputs.artifactRef || 'v1.x' }}-${{ inputs.tags
50+
|| 'all' }}-${{ inputs.linuxOnly && 'linux-only' || 'all-os' }}
5151
cancel-in-progress: false
5252

5353
env:
@@ -110,11 +110,11 @@ jobs:
110110
steps:
111111
- uses: actions/checkout@v7
112112
with:
113-
ref: ${{ inputs.testRef || inputs.artifactRef || 'refactor' }}
113+
ref: ${{ inputs.testRef || inputs.artifactRef || 'v1.x' }}
114114
persist-credentials: false
115115
- uses: actions/checkout@v7
116116
with:
117-
ref: ${{ inputs.artifactRef || 'refactor' }}
117+
ref: ${{ inputs.artifactRef || 'v1.x' }}
118118
path: artifact
119119
persist-credentials: false
120120
- uses: oven-sh/setup-bun@v2

‎scripts/bundle.mjs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const __dirname = path.dirname(__filename);
3333
const cliRoot = path.resolve(__dirname, '..');
3434

3535
const CDK_REPO_URL = 'https://github.com/aws/agentcore-l3-cdk-constructs.git';
36+
const CDK_BRANCH = 'v0.x';
3637

3738
function log(msg) {
3839
console.log(`\n[bundle] ${msg}`);
@@ -68,15 +69,16 @@ function resolveCdkPath() {
6869
return sibling;
6970
}
7071

71-
// 3. Clone latest from GitHub
72+
// 3. Clone the v0 CDK branch from GitHub
7273
const cloneDir = path.join(cliRoot, '.cdk-constructs-clone');
73-
log(`CDK constructs repo not found locally. Cloning latest from GitHub...`);
74+
log(`CDK constructs repo not found locally. Cloning ${CDK_BRANCH} from GitHub...`);
7475

7576
if (fs.existsSync(cloneDir)) {
7677
log('Pulling latest changes...');
77-
run('git', ['pull', 'origin', 'main'], { cwd: cloneDir });
78+
run('git', ['fetch', '--depth', '1', 'origin', CDK_BRANCH], { cwd: cloneDir });
79+
run('git', ['checkout', '--detach', 'FETCH_HEAD'], { cwd: cloneDir });
7880
} else {
79-
run('git', ['clone', '--depth', '1', CDK_REPO_URL, cloneDir]);
81+
run('git', ['clone', '--depth', '1', '--branch', CDK_BRANCH, CDK_REPO_URL, cloneDir]);
8082
}
8183

8284
return cloneDir;

0 commit comments

Comments
 (0)