Skip to content

Commit

Permalink
fix export vars
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Mar 6, 2024
1 parent 44c6c62 commit 1efca91
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/check-unused-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,19 @@ jobs:
PGUSER="keycloak-irsa"
PGPASSWORD="${{ steps.secrets.outputs.AURORA_POSTGRESQL_PASSWORD }}"
export PGPASSWORD
export PGPORT
export PGUSER
export PGHOST
export PGDATABASE
export RETENTION_INTERVAL
user_exists="$(psql -U "${{ steps.secrets.outputs.AURORA_POSTGRESQL_USERNAME }}" -d "$PGDATABASE" -tAc "SELECT 1 FROM pg_roles WHERE rolname='$PGUSER'")"
if [ "$user_exists" = "1" ]; then
PGPASSWORD="$(aws rds generate-db-auth-token --hostname "${PGHOST}" --port "${PGPORT}" --region "${AWS_REGION}" --username "${PGUSER}")"
export PGPASSWORD
export PGPORT
export PGUSER
export PGHOST
export PGDATABASE
export RETENTION_INTERVAL
bash ./.helpers/actions/drop-unused-db.sh
else
echo "The user ${PGUSER} does not exist, skipping."
Expand Down

0 comments on commit 1efca91

Please sign in to comment.