generated from tj-actions/docker-action
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaction.yml
31 lines (29 loc) · 1.03 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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