From c4652d60a79edd2e6b819029eb88b18a65e23885 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Thu, 1 Sep 2022 16:49:12 +0200 Subject: [PATCH] hardcode db password in CI to allow tests from third parties (#1729) --- .github/workflows/bats-mysql.yml | 11 ++++------- .github/workflows/bats-postgres.yml | 13 +++++-------- .github/workflows/bats.yml | 6 ------ 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/bats-mysql.yml b/.github/workflows/bats-mysql.yml index 90e393919..4987cc298 100644 --- a/.github/workflows/bats-mysql.yml +++ b/.github/workflows/bats-mysql.yml @@ -6,9 +6,6 @@ on: database_image: required: true type: string - secrets: - DATABASE_PASSWORD: - required: true env: PREFIX_TEST_NAMES_WITH_FILE: true @@ -23,7 +20,7 @@ jobs: database: image: ${{ inputs.database_image }} env: - MYSQL_ROOT_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} + MYSQL_ROOT_PASSWORD: "secret" ports: - 3306:3306 @@ -61,7 +58,7 @@ jobs: DB_BACKEND: mysql MYSQL_HOST: 127.0.0.1 MYSQL_PORT: 3306 - MYSQL_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} + MYSQL_PASSWORD: "secret" MYSQL_USER: root - name: "Run tests" @@ -70,7 +67,7 @@ jobs: DB_BACKEND: mysql MYSQL_HOST: 127.0.0.1 MYSQL_PORT: 3306 - MYSQL_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} + MYSQL_PASSWORD: "secret" MYSQL_USER: root # @@ -85,7 +82,7 @@ jobs: DB_BACKEND: mysql MYSQL_HOST: 127.0.0.1 MYSQL_PORT: 3306 - MYSQL_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} + MYSQL_PASSWORD: "secret" MYSQL_USER: root if: ${{ always() }} diff --git a/.github/workflows/bats-postgres.yml b/.github/workflows/bats-postgres.yml index 93282594c..63a507cc3 100644 --- a/.github/workflows/bats-postgres.yml +++ b/.github/workflows/bats-postgres.yml @@ -2,9 +2,6 @@ name: Functional tests (Postgres) on: workflow_call: - secrets: - DATABASE_PASSWORD: - required: true env: PREFIX_TEST_NAMES_WITH_FILE: true @@ -19,7 +16,7 @@ jobs: database: image: postgres:latest env: - POSTGRES_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} + POSTGRES_PASSWORD: "secret" ports: - 5432:5432 options: >- @@ -62,7 +59,7 @@ jobs: DB_BACKEND: pgx PGHOST: 127.0.0.1 PGPORT: 5432 - PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }} + PGPASSWORD: "secret" PGUSER: postgres - name: "Run tests (DB_BACKEND: pgx)" @@ -71,7 +68,7 @@ jobs: DB_BACKEND: pgx PGHOST: 127.0.0.1 PGPORT: 5432 - PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }} + PGPASSWORD: "secret" PGUSER: postgres - name: "Build crowdsec and fixture (DB_BACKEND: postgres)" @@ -80,7 +77,7 @@ jobs: DB_BACKEND: postgres PGHOST: 127.0.0.1 PGPORT: 5432 - PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }} + PGPASSWORD: "secret" PGUSER: postgres - name: "Run tests (DB_BACKEND: postgres)" @@ -89,7 +86,7 @@ jobs: DB_BACKEND: postgres PGHOST: 127.0.0.1 PGPORT: 5432 - PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }} + PGPASSWORD: "secret" PGUSER: postgres - name: "Show crowdsec logs" diff --git a/.github/workflows/bats.yml b/.github/workflows/bats.yml index 4e05e6c6a..f8ba05e39 100644 --- a/.github/workflows/bats.yml +++ b/.github/workflows/bats.yml @@ -34,20 +34,14 @@ jobs: uses: ./.github/workflows/bats-mysql.yml with: database_image: mariadb:latest - secrets: - DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}} mysql: uses: ./.github/workflows/bats-mysql.yml with: database_image: mysql:latest - secrets: - DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}} postgres: uses: ./.github/workflows/bats-postgres.yml - secrets: - DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}} hub: uses: ./.github/workflows/bats-hub.yml