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

* add support for pg 17 * enable manually running test action --------- Co-authored-by: Tonye Jack <jtonye@ymail.com>
31 lines
1 KiB
YAML
31 lines
1 KiB
YAML
name: install-postgresql
|
|
description: Install PostgreSQL on the GitHub actions runner and verify the installation.
|
|
author: tj-actions
|
|
inputs:
|
|
postgresql-version:
|
|
description: 'Version of PostgreSQL. e.g 17'
|
|
required: true
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- run: |
|
|
bash $GITHUB_ACTION_PATH/entrypoint.sh
|
|
shell: bash
|
|
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 }}
|
|
|
|
- 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 }}.*"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
branding:
|
|
icon: hard-drive
|
|
color: white
|