-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
91 lines (87 loc) · 4.27 KB
/
action.yml
File metadata and controls
91 lines (87 loc) · 4.27 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Run Flyway Command
description: Runs the flyway command line tool against the given database
inputs:
db-server-name:
description: The database server name.
required: true
db-server-port:
description: The port the database server listens on.
required: false
default: '1433'
db-name:
description: The name of the database to run flyway against.
required: true
trust-server-certificate:
description: A boolean that controls whether or not to validate the SQL Server TLS certificate.
required: false
default: 'false'
migration-files-path:
description: The path to the base directory containing the migration files to process with /src/run-flyway.ps1
required: true
flyway-command:
description: The flyway command to run; e.g migrate, validate, etc.
required: true
migration-history-table:
description: The table where the migration history lives. This is most likely dbo.MigrationHistory or Flyway.MigrationHistory.
required: true
baseline-version:
description: The baseline version to send to the flyway command.
required: false
default: '0'
managed-schemas:
description: A comma separated list of schemas that are to be managed by Flyway.MigrationHistory.
required: true
enable-out-of-order:
description: A switch that allows new migrations that are a lower version number than a current migration to be run.
required: false
default: 'false'
validate-migrations:
description: A switch determining whether flyway should validate the migration scripts before running them.
required: false
default: 'true'
use-integrated-security:
description: A switch defining whether or not to use integrated security. If not provided, a password should be.
required: false
default: 'false'
use-azure-service-principal:
description: A switch to indicate that an Azure Active Directory Service Principal will be used to authenticate with the SQL Server.
required: false
default: 'false'
use-azure-default-credential: # Requires flyway version 10.17.0 or later
description: A switch to indicate that an Azure Active Directory Credential will be used to authenticate with the SQL Server. This credential includes any credential in the Azure Identity Provider
required: false
default: 'false'
username:
description: The username of the user making the changes, which is put into the MigrationHistory table, and also to login with if not using integrated security. This should be the Service Principal ID if use-azure-service-principal is set to true.
required: false
password:
description: The password for the user making changes if not using integrated security. This should be the Service Principal Secret if use-azure-service-principal is set to true.
required: false
extra-parameters:
description: A string containing anything extra that should be added to the flyway command.
required: false
runs:
using: 'composite'
steps:
- name: Update migration scripts
shell: pwsh
run: |
[System.Security.SecureString] $securePassword = if(!!"${{ inputs.password }}") { ConvertTo-SecureString "${{ inputs.password }}" -AsPlainText -Force } else { $null }
${{ github.action_path }}/src/run-flyway.ps1 `
-dbServer "${{ inputs.db-server-name }}" `
-dbServerPort "${{ inputs.db-server-port }}" `
-dbName "${{ inputs.db-name }}" `
-trustServerCertificate:$${{ inputs.trust-server-certificate }} `
-pathToMigrationFiles "${{ inputs.migration-files-path }}" `
-flywayCommand "${{ inputs.flyway-command }}" `
-migrationHistoryTable "${{ inputs.migration-history-table }}" `
-baselineVersion "${{ inputs.baseline-version }}" `
-managedSchemas "${{ inputs.managed-schemas }}" `
-enableOutOfOrder:$${{ inputs.enable-out-of-order }} `
-validateMigrations:$${{ inputs.validate-migrations }} `
-useIntegratedSecurity:$${{ inputs.use-integrated-security }} `
-useActiveDirectoryServicePrincipal:$${{ inputs.use-azure-service-principal }} `
-useActiveDirectoryCredential:$${{ inputs.use-azure-default-credential }} `
-username "${{ inputs.username }}" `
-password $securePassword `
-extraParameters "${{ inputs.extra-parameters }}"