Skip to content

Commit d82a139

Browse files
committed
Merge branch 'dev' into feature/net8-upgrade
2 parents fa867ce + 9655ba0 commit d82a139

File tree

16 files changed

+147
-28
lines changed

16 files changed

+147
-28
lines changed

.autover/changes/1c879063-ec4b-4330-80a2-3f2116812150.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Auto Update Bootstrap Version Changes
2+
3+
on:
4+
schedule:
5+
# Runs at 00:00 UTC every Monday
6+
- cron: '0 0 * * 1'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
id-token: write
13+
14+
jobs:
15+
detect-cdk-bootstrap-changes:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Configure AWS Credentials
19+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4.2.1
20+
with:
21+
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
22+
aws-region: us-west-2
23+
24+
- name: Retrieve secret from AWS Secrets Manager
25+
uses: aws-actions/aws-secretsmanager-get-secrets@5e19ff380d035695bdd56bbad320ca535c9063f2 #v2.0.9
26+
with:
27+
secret-ids: |
28+
AWS_SECRET, ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_NAME }}
29+
parse-json-secrets: true
30+
31+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
32+
with:
33+
fetch-depth: '0'
34+
ref: dev
35+
token: ${{ env.AWS_SECRET_TOKEN }}
36+
37+
- name: Setup .NET
38+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 #v4.3.1
39+
with:
40+
dotnet-version: '8.0.x'
41+
42+
- name: Install AWS CDK
43+
run: |
44+
npm install -g aws-cdk
45+
46+
- name: Create temporary directory
47+
run: mkdir -p temp_cdk
48+
49+
- name: Save New CDK Bootstrap Template
50+
working-directory: temp_cdk
51+
run: |
52+
cdk acknowledge 32775
53+
cdk bootstrap --show-template > newTemplate.yml
54+
55+
- name: Update Template with Required Policies
56+
working-directory: temp_cdk
57+
run: |
58+
yq eval '.Resources.StagingBucket.UpdateReplacePolicy = "Delete"' -i newTemplate.yml
59+
yq eval '.Resources.StagingBucket.DeletionPolicy = "Delete"' -i newTemplate.yml
60+
61+
- name: Check for version changes
62+
id: check_version
63+
run: |
64+
OLD_VERSION=$(yq eval '.Resources.CdkBootstrapVersion.Properties.Value' src/AWS.Deploy.Orchestration/CDK/CDKBootstrapTemplate.yaml)
65+
NEW_VERSION=$(yq eval '.Resources.CdkBootstrapVersion.Properties.Value' temp_cdk/newTemplate.yml)
66+
67+
if [ "$OLD_VERSION" != "$NEW_VERSION" ]; then
68+
echo "Version changed from $OLD_VERSION to $NEW_VERSION"
69+
echo "version_changed=true" >> $GITHUB_OUTPUT
70+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
71+
else
72+
echo "No version change detected"
73+
echo "version_changed=false" >> $GITHUB_OUTPUT
74+
fi
75+
76+
- name: Update CDK Bootstrap Template
77+
if: steps.check_version.outputs.version_changed == 'true'
78+
run: |
79+
cp temp_cdk/newTemplate.yml src/AWS.Deploy.Orchestration/CDK/CDKBootstrapTemplate.yaml
80+
81+
- name: Generate change file
82+
if: steps.check_version.outputs.version_changed == 'true'
83+
env:
84+
NEW_VERSION: ${{ steps.check_version.outputs.new_version }}
85+
run: |
86+
dotnet tool install -g autover --version 0.0.25
87+
autover change --project-name "AWS.Deploy.CLI" -m "Update CDK Bootstrap template to version $NEW_VERSION"
88+
89+
- name: Setup Git User
90+
run: |
91+
git config --global user.email "github-aws-sdk-dotnet-automation@amazon.com"
92+
git config --global user.name "aws-sdk-dotnet-automation"
93+
94+
- name: Delete existing branch if it exists
95+
if: steps.check_version.outputs.version_changed == 'true'
96+
env:
97+
GITHUB_TOKEN: ${{ env.AWS_SECRET_TOKEN }}
98+
run: |
99+
# Check if branch exists and delete it if it does
100+
if git ls-remote --heads origin update-cdk-bootstrap-template | grep -q update-cdk-bootstrap-template; then
101+
git push origin --delete update-cdk-bootstrap-template || true
102+
fi
103+
104+
- name: Create Pull Request
105+
if: steps.check_version.outputs.version_changed == 'true'
106+
env:
107+
GITHUB_TOKEN: ${{ env.AWS_SECRET_TOKEN }}
108+
run: |
109+
git checkout -b update-cdk-bootstrap-template
110+
git add src/AWS.Deploy.Orchestration/CDK/CDKBootstrapTemplate.yaml .autover/
111+
git commit -m "chore: update CDK bootstrap template to version ${{ steps.check_version.outputs.new_version }}"
112+
git push origin update-cdk-bootstrap-template
113+
gh pr create \
114+
--title "Update CDK Bootstrap Template to Version ${{ steps.check_version.outputs.new_version }}" \
115+
--base dev \
116+
--head update-cdk-bootstrap-template \
117+
--fill

.github/workflows/DetectDocGeneratorChanges.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Configure AWS Credentials
13-
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
13+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4.2.1
1414
with:
1515
role-to-assume: ${{ secrets.CI_MAIN_TESTING_ACCOUNT_ROLE_ARN }}
1616
role-duration-seconds: 7200

.github/workflows/UploadDockerImage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Configure AWS Credentials
19-
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
19+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4.2.1
2020
with:
2121
aws-region: us-west-2
2222
role-to-assume: ${{ secrets.DOCKER_IMAGE_UPLOADER_ROLE }}

.github/workflows/aws-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Configure AWS Credentials
20-
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
20+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4.2.1
2121
with:
2222
role-to-assume: ${{ secrets.CI_MAIN_TESTING_ACCOUNT_ROLE_ARN }}
2323
role-duration-seconds: 7200
@@ -30,7 +30,7 @@ jobs:
3030
$roleArn=$(cat ./response.json)
3131
"roleArn=$($roleArn -replace '"', '')" >> $env:GITHUB_OUTPUT
3232
- name: Configure Test Runner Credentials
33-
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
33+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4.2.1
3434
with:
3535
role-to-assume: ${{ steps.lambda.outputs.roleArn }}
3636
role-duration-seconds: 7200

.github/workflows/create-release-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
steps:
2626
# Assume an AWS Role that provides access to the Access Token
2727
- name: Configure AWS Credentials
28-
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
28+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4.2.1
2929
with:
3030
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
3131
aws-region: us-west-2
3232
# Retrieve the Access Token from Secrets Manager
3333
- name: Retrieve secret from AWS Secrets Manager
34-
uses: aws-actions/aws-secretsmanager-get-secrets@fbd65ea98e018858715f591f03b251f02b2316cb #v2.0.8
34+
uses: aws-actions/aws-secretsmanager-get-secrets@5e19ff380d035695bdd56bbad320ca535c9063f2 #v2.0.9
3535
with:
3636
secret-ids: |
3737
AWS_SECRET, ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_NAME }}

.github/workflows/doc-builder.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Configure AWS Credentials
19-
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
19+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4.2.1
2020
with:
2121
role-to-assume: ${{ secrets.CI_MAIN_TESTING_ACCOUNT_ROLE_ARN }}
2222
aws-region: us-west-2
2323
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
2424
with:
2525
fetch-depth: '0'
26-
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 #v4.7.1
26+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
2727
with:
2828
python-version: 3.x
2929
- name: Setup .NET 8

.github/workflows/handle-stale-discussions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
discussions: write
1414
steps:
1515
- name: Stale discussions action
16-
uses: aws-github-ops/handle-stale-discussions@711a9813957be17629fc6933afcd8bd132c57254 #v1.6
16+
uses: aws-github-ops/handle-stale-discussions@c0beee451a5d33d9c8f048a6d4e7c856b5422544 #v1.6.0
1717
env:
1818
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/semgrep-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
p/owasp-top-ten
3131
3232
- name: Upload SARIF file for GitHub Advanced Security Dashboard
33-
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 #v3.28.16
33+
uses: github/codeql-action/upload-sarif@fca7ace96b7d713c7035871441bd52efbe39e27e #v3.28.19
3434
with:
3535
sarif_file: semgrep.sarif
3636
if: always()

.github/workflows/sync-main-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
steps:
2727
# Assume an AWS Role that provides access to the Access Token
2828
- name: Configure AWS Credentials
29-
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
29+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4.2.1
3030
with:
3131
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
3232
aws-region: us-west-2
3333
# Retrieve the Access Token from Secrets Manager
3434
- name: Retrieve secret from AWS Secrets Manager
35-
uses: aws-actions/aws-secretsmanager-get-secrets@fbd65ea98e018858715f591f03b251f02b2316cb #v2.0.8
35+
uses: aws-actions/aws-secretsmanager-get-secrets@5e19ff380d035695bdd56bbad320ca535c9063f2 #v2.0.9
3636
with:
3737
secret-ids: |
3838
AWS_SECRET, ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_NAME }}

0 commit comments

Comments
 (0)