From f43ad01b89beea9733197b00df1b0ea41ae19ae0 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 13 Oct 2022 11:56:06 +0800 Subject: [PATCH] Set PGPASSWORD in env to call psql without password prompt --- .github/workflows/run-tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 5a22f661d..2f9b2e5be 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -66,7 +66,7 @@ jobs: - name: Database Migration run: | yarn workspace @omnivore/db migrate - psql --host localhost --port ${{ job.services.postgres.ports[5432] }} --user postgres --password -c "CREATE USER app_user WITH ENCRYPTED PASSWORD 'app_pass';GRANT omnivore_user to app_user;" + psql -p ${{ job.services.postgres.ports[5432] }} -U postgres -c "CREATE USER app_user WITH ENCRYPTED PASSWORD 'app_pass';GRANT omnivore_user to app_user;" env: PG_HOST: localhost PG_PORT: ${{ job.services.postgres.ports[5432] }} @@ -74,6 +74,7 @@ jobs: PG_PASSWORD: postgres PG_DB: omnivore_test ELASTIC_URL: http://localhost:${{ job.services.elastic.ports[9200] }}/ + PGPASSWORD: postgres # This is required for the psql command to work without a password prompt - name: TypeScript, Lint, Tests run: | source ~/.nvm/nvm.sh