Skip to content

Commit

Permalink
ci: set pgpassword env as secret
Browse files Browse the repository at this point in the history
  • Loading branch information
tyknkd committed May 13, 2024
1 parent c70bf57 commit ff6f71d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:

- name: Initialize databases
shell: bash
env:
PGPASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
run: |
source .env
chmod +x ./docker-databases/docker-entrypoint-initdb.d/init-additional-db.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
set -e # Exit script immediately if command exits with non-zero status
IFS=',' # Internal field separator

export PGPASSWORD="$POSTGRES_PASSWORD"

for database in $ADDITIONAL_POSTGRES_DB; do
echo "Creating database: '$database'"
psql -v ON_ERROR_STOP=1 --host "$POSTGRES_HOST" --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -c "create database $database"
Expand Down

0 comments on commit ff6f71d

Please sign in to comment.