Skip to content

Commit bea9698

Browse files
committed
feat(cd): include version
1 parent 5a19705 commit bea9698

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.github/workflows/cd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727

2828
steps:
2929
- uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Set version
34+
run:
35+
echo "VERSION=`git describe --tags HEAD | tr -d '\n'`" >> $GITHUB_ENV
3036

3137
- uses: actions/setup-node@v3
3238
with:

cdk/RegistryApp.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ export class RegistryApp extends App {
77
lambdaSources,
88
repository,
99
gitHubOICDProviderArn,
10+
version,
1011
}: {
1112
lambdaSources: RegistryLambdas
1213
repository: Repository
1314
gitHubOICDProviderArn: string
15+
version: string
1416
}) {
15-
super()
17+
super({
18+
context: {
19+
version,
20+
},
21+
})
1622

1723
new RegistryStack(this, {
1824
lambdaSources,

cdk/registry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const repository = {
1313
repoUrl.pathname.split('/')[2]?.replace(/\.git$/, '') ??
1414
'public-parameter-registry-aws-js',
1515
}
16+
const version = process.env.VERSION ?? pJSON.version
1617

1718
export type PackedLambda = { lambdaZipFile: string; handler: string }
1819

@@ -43,4 +44,5 @@ new RegistryApp({
4344
gitHubOICDProviderArn: await ensureGitHubOIDCProvider({
4445
iam: new IAMClient({}),
4546
}),
47+
version,
4648
})

0 commit comments

Comments
 (0)