-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
77 lines (70 loc) · 3.07 KB
/
action.yml
File metadata and controls
77 lines (70 loc) · 3.07 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
name: SQL View to Create Table File Generator
description: Takes the views from the specified schema and creates .sql files with create table statements for them
inputs:
schema-names:
description: A comma separated list of schemas that hold the views that are to have create table scripts created for them.
required: true
db-name:
description: The name of the database to use.
required: true
db-server:
description: The name of the database server to use.
required: true
default: localhost
db-port:
description: The name of the database server port to use.
required: false
default: '1433'
default-branch:
description: The name of the default branch of the running repo.
required: true
default: main
nuget-retrieval-url:
description: The url where the packages to compare against the generated files can be found.
required: true
publish-packages:
description: A flag determining whether or not to publish nuget packages with the create table files.
required: false
default: 'false'
nuget-publish-url:
description: The url where the generated packages will be published. This should be set if the `publish-packages` flag is `true`, otherwise an error will occur.
required: false
nuget-api-key:
description: The API key for the `nuget-publish-url`. If that url is set, this should be too.
required: false
nuget-folder:
description: The name of the folder to put the nuget files that will be compared to the generated create table files. Defaults to './.build/.nuget' in this action's folder.
required: false
package-folder:
description: The name of the folder where the generated create table files will go. Defaults to './.build/.packages' in this action's folder.
required: false
repository-url:
description: Use when publishing to GitHub Packages. The url to the repository which should house the published packages.
required: false
runs:
using: 'composite'
steps:
- name: Generate the create table files
shell: pwsh
run: |
$inputSchemas = "${{ inputs.schema-names }}"
if(!$inputSchemas) { exit 0 }
$schemas = $inputSchemas.Split(',');
$executablePath = if($IsWindows) { "${{ github.action_path }}\.build-win" } else { "${{ github.action_path }}\.build-linux" }
foreach($schema in $schemas)
{
$schema = $schema.Trim();
& $executablePath\publishViewsInSchema.ps1 -SchemaName $schema `
-DbName "${{ inputs.db-name }}" `
-DbServer "${{ inputs.db-server }}" `
-Port "${{ inputs.db-port }}" `
-NugetFolder "${{ inputs.nuget-folder }}" `
-Publish:$${{ inputs.publish-packages }} `
-DefaultBranchName "${{ inputs.default-branch }}" `
-NugetRetrievalUrl "${{ inputs.nuget-retrieval-url }}" `
-NugetPublishUrl "${{ inputs.nuget-publish-url }}" `
-PackageFolder "${{ inputs.package-folder }}" `
-NugetApiKey "${{ inputs.nuget-api-key }}" `
-RepositoryUrl "${{ inputs.repository-url }}" `
-Verbose
}