Skip to content

Commit 02b5bd4

Browse files
fixed up branch naming
1 parent 60e0d38 commit 02b5bd4

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

setup/database-name-branch-based/action.yml

+4-21
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ name: Determine the deployment database name
22
description: Geneates the database in which to deploy into
33
inputs:
44
source-database-name:
5-
description: The root name of the database to copy from (excluding dev, test, prod)
5+
description: The root name of the database to use (excluding dev, test, prod)
66
required: true
7-
include-branch:
8-
description: Whether to include the branch name in the database name
9-
required: false
10-
default: $true
117
outputs:
128
database-name:
139
description: The name of the database to use for deployment
@@ -16,35 +12,22 @@ runs:
1612
using: "composite"
1713
steps:
1814
- name: Get branch name (merge)
19-
if: github.event_name != 'pull_request' && ${{ inputs.include-branch }}
15+
if: github.event_name != 'pull_request'
2016
shell: bash
2117
run: |
2218
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
2319
2420
- name: Get branch name (pull request)
25-
if: github.event_name == 'pull_request' && ${{ inputs.include-branch }}
21+
if: github.event_name == 'pull_request'
2622
shell: bash
2723
run: |
2824
echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
2925
30-
- name: Determine new database name with branch attached
31-
if: ${{ inputs.include-branch }}
32-
shell: bash
33-
run: |
34-
echo "DATABASE_NAME=$(echo ${{ inputs.source-database-name }}_${{ env.BRANCH_NAME }}.toUpperCase() | tr / -)" >> $GITHUB_ENV
35-
36-
- name: Determine new database name with no branch
37-
if: ${{ inputs.include-branch }} == $false
38-
shell: bash
39-
run: |
40-
echo "DATABASE_NAME=$(echo ${{ inputs.source-database-name }} | tr / -)" >> $GITHUB_ENV
41-
4226
- name: BRANCH_NAME
4327
id: determine-database-name
4428
shell: bash
4529
run: |
46-
echo "::set-output name=database-name::${{ env.DATABASE_NAME }}"
47-
30+
echo "::set-output name=database-name::$(echo ${{ inputs.source-database-name }}_${{ env.BRANCH_NAME }} | tr a-z A-Z)"
4831
4932
- name: show target name
5033
shell: bash

0 commit comments

Comments
 (0)