Skip to content

Commit

Permalink
Fix authentication method on PostgreSQL for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Sep 14, 2023
1 parent 03cac2a commit e2dd600
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,20 @@ jobs:
- name: Start PostgreSQL on Windows
# see https://www.cybertec-postgresql.com/en/postgresql-github-actions-continuous-integration/
run: |
echo $env:PGBIN >> $Env:GITHUB_PATH
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
$env:PGPASSWORD = 'root'
& $env:PGBIN\createdb --owner=postgres eccube_db
echo $env:PGBIN >> $Env:GITHUB_PATH
(Get-Content $env:PGDATA\postgresql.conf) | foreach { $_ -replace "#password_encryption = scram-sha-256","password_encryption = md5" } | Set-Content $env:PGDATA\postgresql.conf
(Get-Content $env:PGDATA\pg_hba.conf) | foreach { $_ -replace "scram-sha-256","md5" } | Set-Content $env:PGDATA\pg_hba.conf
Restart-Service -InputObject $pgService -Force
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
& $env:PGBIN\createuser -U postgres -d -R eccube_db_user
& $env:PGBIN\psql -U postgres -c "ALTER role eccube_db_user with password 'password';" postgres
& $env:PGBIN\psql -U postgres -c "select rolname,rolpassword from pg_authid;" postgres
& $env:PGBIN\createdb --owner=eccube_db_user eccube_db
Get-Content $env:PGDATA\postgresql.conf
- name: Setup PHP
uses: nanasess/setup-php@master
Expand All @@ -195,8 +203,8 @@ jobs:
- name: Setup to EC-CUBE
env:
DB: pgsql
DBUSER: postgres
DBPASS: root
DBUSER: eccube_db_user
DBPASS: password
DBNAME: eccube_db
DBPORT: 5432
DBSERVER: 127.0.0.1
Expand Down

0 comments on commit e2dd600

Please sign in to comment.