Skip to content

Commit

Permalink
feat: Fix happy-cleanup aws profile setting (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlokshin-czi authored Oct 9, 2024
1 parent e4598c6 commit 83129b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/actions/happy-cleanup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ runs:
set -o pipefail
date=`date +%Y-%m-%d'T'%H:%M'Z' -d "$TIME ago"`
list="happy list --output json --env $ENV"
list="happy list --aws-profile "" --output json --env $ENV"
force=""
if [[ ${ALL} ]]; then
list="happy list --all --output json --env $ENV"
list="happy list --aws-profile "" --all --output json --env $ENV"
force="--force"
fi
if [[ ! -z ${EXCLUDE} ]]; then
for i in $($(echo $list) | jq -r --arg date "$date" --arg exclude "$EXCLUDE" '.[] | select(.last_updated < $date) | select(any(.stack; contains($exclude))|not) | .stack'); do
echo "Deleting stack: $i"
happy delete $i --env $ENV "$force"
happy delete --aws-profile "" $i --env $ENV "$force"
done
exit
fi
for i in $($(echo $list) | jq -r --arg date "$date" '.[] | select(.last_updated < $date) | .stack'); do
echo "Deleting stack: $i"
happy delete $i --env $ENV "$force"
done
happy delete --aws-profile "" $i --env $ENV "$force"
done

0 comments on commit 83129b4

Please sign in to comment.