Skip to content

Commit 5e5d5a8

Browse files
committed
validation for project name
1 parent 3d54728 commit 5e5d5a8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/cloudFormation.yml

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ jobs:
3636
runs-on: ubuntu-latest
3737

3838
steps:
39+
- name: Validate Project Name
40+
env:
41+
PROJECT_NAME: ${{ github.event.inputs.project_name }}
42+
run: |
43+
if ! [[ "$PROJECT_NAME" =~ ^[a-zA-Z][a-zA-Z0-9]*$ ]]; then
44+
echo "Project Name must begin with a letter and contain only alphanumeric characters."
45+
exit 1
46+
fi
47+
3948
- name: Checkout
4049
uses: actions/checkout@v2
4150

.github/workflows/stacks/backendStackCF.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Resources:
3434
RDSDatabase:
3535
Type: AWS::RDS::DBInstance
3636
Properties:
37-
DBName: !Sub '${ProjectName}-db'
37+
DBName: !Sub '${ProjectName}'
3838
MasterUsername: !Ref DBUser
3939
Engine: postgres
4040
MasterUserPassword: !Ref DBPassword

0 commit comments

Comments
 (0)