Skip to content

Commit

Permalink
chore: update Github workflow to detect invalid CDK bootstrap Staging…
Browse files Browse the repository at this point in the history
…Bucket config
  • Loading branch information
philasmar committed Nov 16, 2023
1 parent 71ab0bd commit 4be9ef2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/DetectCDKBootstrapVersionChanges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ jobs:
- name: Install AWS CDK
run: |
npm install -g aws-cdk
- name: Get Staging Bucket Update/Replace Policy
id: stagingBucketUpdateReplacePolicy
run: |
echo "::set-output name=update-replace-policy::$(yq '.Resources.StagingBucket.UpdateReplacePolicy' 'src/AWS.Deploy.Orchestration/CDK/CDKBootstrapTemplate.yaml')"
- name: Get Staging Bucket Deletion Policy
id: stagingBucketDeletionPolicy
run: |
echo "::set-output name=deletion-policy::$(yq '.Resources.StagingBucket.DeletionPolicy' 'src/AWS.Deploy.Orchestration/CDK/CDKBootstrapTemplate.yaml')"
- name: Fail If Update/Replace Policy Not 'Delete'
if: steps.stagingBucketUpdateReplacePolicy.outputs.update-replace-policy != 'Delete'
run: |
echo "The 'UpdateReplacePolicy' of the 'StaginBucket' in the CDK bootstrap template should be 'Delete'."
exit 1
- name: Fail If Deletion Policy Not 'Delete'
if: steps.stagingBucketDeletionPolicy.outputs.deletion-policy != 'Delete'
run: |
echo "The 'DeletionPolicy' of the 'StaginBucket' in the CDK bootstrap template should be 'Delete'."
exit 1
- name: Save New CDK Bootstrap Template
run: |
cdk bootstrap --show-template > newTemplate.yml
Expand Down

0 comments on commit 4be9ef2

Please sign in to comment.