0
0
Fork 0
mirror of https://github.com/tj-actions/install-postgresql.git synced 2024-12-20 01:18:18 +00:00

Merge branch 'main' into chore/update-readme

This commit is contained in:
repo-ranger[bot] 2023-09-12 17:27:59 +00:00 committed by GitHub
commit 74524f5979
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -17,7 +17,7 @@ This Github action installs PostgreSQL on the GitHub actions runner and verifies
- name: Setup PostgreSQL
uses: tj-actions/install-postgresql@v1
with:
postgresql_version: 15
postgresql-version: 15
```
> NOTE: This updates the installed PostgreSQL version with the specified version and updates the PATH.
@ -28,7 +28,7 @@ This Github action installs PostgreSQL on the GitHub actions runner and verifies
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|----------------------------------------------------------------------------------------|--------|----------|---------|-------------------------------|
| <a name="input_postgresql_version"></a>[postgresql\_version](#input_postgresql_version) | string | true | | Version of PostgreSQL. e.g 15 |
| <a name="input_postgresql-version"></a>[postgresql-version](#input_postgresql-version) | string | true | | Version of PostgreSQL. e.g 15 |
<!-- AUTO-DOC-INPUT:END -->

View file

@ -2,7 +2,7 @@ name: install-postgresql
description: Install PostgreSQL on the GitHub actions runner and verify the installation.
author: tj-actions
inputs:
postgresql_version:
postgresql-version:
description: 'Version of PostgreSQL. e.g 15'
required: true
@ -15,14 +15,14 @@ runs:
env:
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
INPUT_POSTGRESQL_VERSION: ${{ inputs.postgresql_version }}
INPUT_POSTGRESQL_VERSION: ${{ inputs.postgresql-version }}
- name: Verify PostgreSQL
run: |
# Check the postgresql version
POSTGRESQL_VERSION=$(psql --version | awk '{print $3}')
if [[ "$POSTGRESQL_VERSION" != "${{ inputs.postgresql_version }}."* ]]; then
echo "PostgreSQL version $POSTGRESQL_VERSION does not match the expected version ${{ inputs.postgresql_version }}.*"
if [[ "$POSTGRESQL_VERSION" != "${{ inputs.postgresql-version }}."* ]]; then
echo "PostgreSQL version $POSTGRESQL_VERSION does not match the expected version ${{ inputs.postgresql-version }}.*"
exit 1
fi
shell: bash