From fb9169149f1270eeb9a6dd2376d5f118a69cbaf2 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Tue, 7 May 2024 15:08:02 +0200 Subject: [PATCH] use test credential for Postgres - PG is running on localhost => no risk of undue access (moreover, this is only a test database) - This will allow external PR. - Also remove DJANGO_QECRET_KEY, which is selected randomly if not specified in environment --- .github/workflows/backend-api-tests.yml | 1 - .github/workflows/backend-coverage.yaml | 5 ++--- .github/workflows/functional-tests.yml | 5 ++--- .github/workflows/startup-tests.yml | 2 -- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/backend-api-tests.yml b/.github/workflows/backend-api-tests.yml index 1b6946035..41dc7df80 100644 --- a/.github/workflows/backend-api-tests.yml +++ b/.github/workflows/backend-api-tests.yml @@ -39,7 +39,6 @@ jobs: working-directory: ${{env.working-directory}} run: | touch .env - echo DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> .env echo DJANGO_DEBUG='True' >> .env echo DB_HOST=localhost >> .env echo EMAIL_HOST=localhost >> .env diff --git a/.github/workflows/backend-coverage.yaml b/.github/workflows/backend-coverage.yaml index fd19cc460..5b425fd7a 100644 --- a/.github/workflows/backend-coverage.yaml +++ b/.github/workflows/backend-coverage.yaml @@ -20,7 +20,7 @@ jobs: image: postgres:14.1 env: POSTGRES_USER: postgres - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + POSTGRES_PASSWORD: postgres # test credential POSTGRES_DB: postgres ports: ["5432:5432"] options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 @@ -46,11 +46,10 @@ jobs: working-directory: ${{env.working-directory}} run: | touch .env - echo DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> .env echo DJANGO_DEBUG='True' >> .env echo POSTGRES_NAME=postgres >> .env echo POSTGRES_USER=postgres >> .env - echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> .env + echo POSTGRES_PASSWORD=postgers >> .env echo DB_HOST=localhost >> .env echo EMAIL_HOST=localhost >> .env echo EMAIL_PORT=1025 >> .env diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 801ac6a7b..829891c61 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -21,7 +21,7 @@ jobs: image: postgres:14.1 env: POSTGRES_USER: postgres - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + POSTGRES_PASSWORD: postgres # test credential POSTGRES_DB: postgres ports: ["5432:5432"] options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 @@ -68,12 +68,11 @@ jobs: working-directory: ${{ env.backend-directory }} run: | touch .env - echo DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> .env echo DJANGO_SUPERUSER_EMAIL=admin@tests.com >> .env echo DJANGO_SUPERUSER_PASSWORD=1234 >> .env echo POSTGRES_NAME=postgres >> .env echo POSTGRES_USER=postgres >> .env - echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> .env + echo POSTGRES_PASSWORD=postgres >> .env echo DB_HOST=localhost >> .env echo CISO_ASSISTANT_SUPERUSER_EMAIL='' >> .env echo CISO_ASSISTANT_URL=http://localhost:4173 >> .env diff --git a/.github/workflows/startup-tests.yml b/.github/workflows/startup-tests.yml index 6d5b84a57..371d45098 100644 --- a/.github/workflows/startup-tests.yml +++ b/.github/workflows/startup-tests.yml @@ -60,7 +60,6 @@ jobs: working-directory: ${{ env.backend-directory }} run: | touch .env - echo DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> .env echo DJANGO_SUPERUSER_EMAIL=admin@tests.com >> .env echo DJANGO_SUPERUSER_PASSWORD=1234 >> .env echo POSTGRES_NAME=postgres >> .env @@ -114,7 +113,6 @@ jobs: working-directory: ${{ env.backend-directory }} run: | touch .env - echo DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> .env export $(grep -v '^#' .env | xargs) - name: Config the Docker app run: |