File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 22# This script pauses AWS resources (ECS service and RDS Aurora cluster) in the current AWS account.
33
44set -e # Exit on error
5- trap ' echo "Error occurred at line $LINENO while executing function $FUNCNAME"' ERR
5+
6+ # Error handler function
7+ function error_handler() {
8+ local script_name=$( basename " $0 " )
9+ echo " Error in script: $script_name "
10+ echo " Error occurred at line $LINENO in function ${FUNCNAME[1]} "
11+ exit 1
12+ }
13+
14+ trap ' error_handler' ERR
615# Parse arguments
716ENVIRONMENT=${1}
817STACK_PREFIX=${2}
918
1019# Validate required arguments
1120function validate_args() {
21+ if [ -z " $ENVIRONMENT " ]; then
22+ echo " Error: Environment is required as the first parameter"
23+ exit 1
24+ fi
1225 if [ -z " $STACK_PREFIX " ]; then
1326 echo " Error: Stack prefix is required as the second parameter"
1427 exit 1
Original file line number Diff line number Diff line change 8080 steps :
8181 - uses : actions/checkout@v4
8282 - name : Run Trivy vulnerability scanner in repo mode
83- uses : aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # 0.30 .0
83+ uses : aquasecurity/trivy-action@76071ef0d7ec797419534a183b498b4d6366cf37 # 0.31 .0
8484 with :
8585 format : " sarif"
8686 output : " trivy-results.sarif"
You can’t perform that action at this time.
0 commit comments