Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPS-1118: Bau gha add lint on pre-merge and post-merge checks. #164

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/post-merge-deploy-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
aws-region: eu-west-2

- name: SAM Validate
run: sam validate --region ${{ env.AWS_REGION }} -t deploy/template.yaml
run: sam validate --region ${{ env.AWS_REGION }} -t deploy/template.yaml --lint

- name: Login to Amazon ECR
id: login-ecr
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pre-merge-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ jobs:

run-premerge-checks:
runs-on: ubuntu-latest
env:
AWS_REGION: eu-west-2
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: SAM Validate
run: sam validate --region ${{ env.AWS_REGION }} -t deploy/template.yaml --lint

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/secure-post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
aws-region: eu-west-2

- name: SAM Validate
run: sam validate --region ${{ env.AWS_REGION }} -t deploy/template.yaml
run: sam validate --region ${{ env.AWS_REGION }} -t deploy/template.yaml --lint

# Likely source of node warning
# https://github.com/aws-actions/amazon-ecr-login/issues/586
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ repos:
args: [ --allow-missing-credentials ]
- id: detect-private-key
- repo: https://github.com/awslabs/cfn-python-lint
rev: v1.5.0 # The version of cfn-lint to use
rev: v1.15.2 # The version of cfn-lint to use
hooks:
- id: cfn-python-lint
files: .template\.yaml$
- repo: https://github.com/bridgecrewio/checkov.git
rev: '3.2.174'
rev: '3.2.256'
hooks:
- id: checkov
verbose: true
Expand Down
8 changes: 4 additions & 4 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -267,23 +267,23 @@
"filename": "deploy/template.yaml",
"hashed_secret": "b63bf00edb07af6ffba7f7ceb7ed573a913271f7",
"is_verified": false,
"line_number": 620
"line_number": 628
},
{
"type": "Secret Keyword",
"filename": "deploy/template.yaml",
"hashed_secret": "42af5cf9fcf4f09147c032a0fb4877f5cf626bbc",
"is_verified": false,
"line_number": 621
"line_number": 629
},
{
"type": "Secret Keyword",
"filename": "deploy/template.yaml",
"hashed_secret": "7584a31168b8e8f62d9b84b7b95d239b99fad815",
"is_verified": false,
"line_number": 623
"line_number": 631
}
]
},
"generated_at": "2024-10-04T13:38:50Z"
"generated_at": "2024-10-18T08:56:25Z"
}
10 changes: 9 additions & 1 deletion deploy/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ Resources:
Type:
AWS::S3::Bucket
#checkov:skip=CKV_AWS_18: This is the bucket where our access logs go and AWS advise not sending a bucket's access logs to itself.
Metadata:
cfn-lint:
config:
ignore_checks:
- W3045 # Using a legacy 'AccessControl: LogDeliveryWrite' setup for now
Properties:
BucketName: !Join
- "-"
Expand Down Expand Up @@ -443,7 +448,10 @@ Resources:
- !Ref "Environment"
- desiredTaskCount
EnableECSManagedTags: false
HealthCheckGracePeriodSeconds: 60
HealthCheckGracePeriodSeconds: !If
- UseCanaryDeployment
- !Ref AWS::NoValue
- 60
LaunchType: FARGATE
LoadBalancers: !If
- UseCanaryDeployment
Expand Down