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:
parent
d9e5a3fe4f
commit
ecfbb9388d
6 changed files with 173 additions and 3 deletions
17
action.yml
17
action.yml
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue