Skip to content

Commit

Permalink
AT-73372 re-apply
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco authored Sep 9, 2024
1 parent 48370a0 commit 8bc66dd
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ inputs:
runs:
using: 'composite'
steps:
- if: |
inputs.database_name == '' ||
inputs.github_actor == '' ||
inputs.database_name == 'master' ||
inputs.database_name == 'main' ||
(inputs.branch_action != 'Delete' && inputs.source_database_name == '')
shell: bash
run: |
echo "Inputs validation failed."
exit 1
- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -40,27 +51,11 @@ runs:
aws-access-key-id: ${{ inputs.aws_access_key }}
aws-secret-access-key: ${{ inputs.aws_secret_key }}
aws-region: ${{ inputs.aws_region }}

- name: Delete Branch Database
shell: bash
if: ${{ inputs.branch_action == 'Delete' }}
run: |
echo "Deleting branch database ${{ inputs.database_name }}"
chmod +x ./data/delete_branch_database.sh
./data/delete_branch_database.sh BuildUserDatabaseConnectionSettings ${{ inputs.database_name }}
- name: Create Branch Database
if: ${{ inputs.branch_action == 'Create' }}
shell: bash
run: |
echo "Creating branch database ${{ inputs.database_name }}"
chmod +x ./data/create_branch_database.sh
./data/create_branch_database.sh BuildUserDatabaseConnectionSettings ${{ inputs.database_name }} ${{ inputs.github_actor }} ${{ inputs.source_database_name }} false

- name: Recreate Branch Database
if: ${{ inputs.branch_action == 'Recreate' }}
- env:
DATABASE: ${{ inputs.database_name }}
USERNAME: ${{ inputs.github_actor }}
SOURCE_DB: ${{ inputs.source_database_name }}
ACTION: ${{ inputs.branch_action }}
shell: bash
run: |
echo "Recreate branch database: ${{ inputs.database_name }}"
chmod +x ./data/create_branch_database.sh
./data/create_branch_database.sh BuildUserDatabaseConnectionSettings ${{ inputs.database_name }} ${{ inputs.github_actor }} ${{ inputs.source_database_name }} true
run: bash ${{ github.action_path }}/script.sh

0 comments on commit 8bc66dd

Please sign in to comment.