0
0
Fork 0
mirror of https://github.com/tj-actions/pg-dump.git synced 2025-06-11 13:12:32 +00:00

feat: add support for installing postgresql (#135)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Tonye Jack 2023-09-12 13:02:42 -06:00 committed by GitHub
parent d9e5a3fe4f
commit ecfbb9388d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 173 additions and 3 deletions

View file

@ -2,6 +2,9 @@ name: pg-dump
description: Run pg_dump to generate a backup
author: tj-actions
inputs:
postgresql_version:
description: 'Version of PostgreSQL. e.g 15'
required: false
database_url:
description: 'Database URL'
required: true
@ -16,10 +19,20 @@ inputs:
runs:
using: 'composite'
steps:
- name: Setup PostgreSQL
uses: tj-actions/install-postgresql@v2
if: inputs.postgresql_version != ''
with:
postgresql-version: ${{ inputs.postgresql_version }}
- run: |
mkdir -p $(dirname "${{ inputs.path }}")
pg_dump ${{ inputs.options }} -d "${{ inputs.database_url }}" > "${{ inputs.path }}"
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_PATH: ${{ inputs.path }}
INPUT_DATABASE_URL: ${{ inputs.database_url }}
INPUT_OPTIONS: ${{ inputs.options }}
branding:
icon: hard-drive
color: white