Skip to content

Commit a480644

Browse files
feat: expose typeorm config object (#32)
1 parent e83e6ea commit a480644

8 files changed

Lines changed: 55725 additions & 52494 deletions

File tree

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Check out our [example repositories](https://github.com/githubocto?q=flat-demo&t
2929

3030
### Option 1: Flat Editor VSCode Extension
3131

32-
The easiest way to get a Flat Data action up and running is with the accompanying [Flat Editor VSCode Extension](https://marketplace.visualstudio.com/items?itemName=GitHubOCTO.flat) which helps you author Flat yml files.
32+
The easiest way to get a Flat Data action up and running is with the accompanying [Flat Editor VSCode Extension](https://marketplace.visualstudio.com/items?itemName=GitHubOCTO.flat) which helps you author Flat yml files.
3333

3434
To use it, [install the extension](https://marketplace.visualstudio.com/items?itemName=GitHubOCTO.flat) and then invoke `Flat Editor` from the command palette within VSCode (Mac: ⌘⇧P, Others:ctrl-shift-P).
3535

@@ -85,13 +85,13 @@ These two modes are exclusive; you cannot mix settings for these two in one Flat
8585

8686
#### `http_url`
8787

88-
A URL from which to fetch data. Specifying this input puts Flat into `http` mode.
88+
A URL from which to fetch data. Specifying this input puts Flat into `http` mode.
8989

9090
This can be any endpoint: a json, csv, png, zip, xlsx, etc.
9191

9292
#### `downloaded_filename`
9393

94-
The name of the file to store data fetched by Flat.
94+
The name of the file to store data fetched by Flat.
9595

9696
In `http` mode this can be anything. This can be any endpoint: a json, csv, txt, png, zip, xlsx, etc. file
9797

@@ -111,7 +111,6 @@ If your `http_url` string contains secrets, you can choose to mask it from the c
111111

112112
`mask: '["${{ secrets.SECRET1 }}", "${{ secrets.SECRET2 }}"]'`
113113
114-
115114
### SQL Mode
116115
117116
#### `sql_connstring`
@@ -128,19 +127,30 @@ A URI-style database connection string. Flat will use this connection string to
128127
>
129128
> If you're using the [flat-vscode extension](https://github.com/githubocto/flat-vscode), this is handled for you.
130129

131-
132130
#### `sql_queryfile`
133131

134132
The pathname of the file containing the SQL query that will be issued to the database. Defaults to `.github/workflows/query.sql`. This path is relative to the root of your repo.
135133

136134
#### `downloaded_filename`
137135

138-
The name of the file to store data fetched by Flat.
136+
The name of the file to store data fetched by Flat.
139137

140138
In `sql` mode this should be one of `csv` or `json`. SQL query results will be serialized to disk in the specified format.
141139

142140
> ⚠️ While the JSON is not pretty-printed, CSV is often a more efficient serialization for tabular data.
143141

142+
#### `typeorm_config` (optional)
143+
144+
A JSON string representing a configuration passed to [TypeORMs createConnection function](https://orkhan.gitbook.io/typeorm/docs/connection-api#main-api).
145+
146+
A common use case for this value is connecting your [Flat action to a Heroku database](https://github.com/typeorm/typeorm/issues/278).
147+
148+
For instance, you can pass the following configuration string to your Flat action in order to connect to a Heroku Postgres database.
149+
150+
```yaml
151+
typeorm_config: '{"ssl":true,"extra":{"ssl":{"rejectUnauthorized":false}}}'
152+
```
153+
144154
#### `postprocess` (optional)
145155

146156
A path to a local Deno javascript or typescript file for postprocessing the `downloaded_filename` file. Read more in the ["Postprocessing section"](https://github.com/githubocto/flat#postprocessing).
@@ -155,7 +165,7 @@ A signed number describing the number of bytes that changed in this run. If the
155165

156166
You can add a `postprocess` input in the Action which is path to a [deno](https://deno.land) Javascript or Typescript script that will be invoked to postprocess your data after it is fetched. This path is relative to the root of your repo.
157167

158-
The script can use either `Deno.args[0]` or the name of the `downloaded_filename` to access the file fetched by Flat Data.
168+
The script can use either `Deno.args[0]` or the name of the `downloaded_filename` to access the file fetched by Flat Data.
159169

160170
```ts
161171
import { readJSON, writeJSON } from 'https://deno.land/x/flat/mod.ts'

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ inputs:
1818
description: 'A path (relative to the root of your repo) of a SQL query file to execute for fetching data.'
1919
required: false
2020
default: '.github/workflows/query.sql'
21+
typeorm_config:
22+
description: 'A JSON string representing a configuration passed to TypeORMs createConnection function'
23+
required: false
2124
postprocess:
2225
description: 'A path (relative to the root of your repo) or a URL to a deno postprocessing script.'
2326
required: false

dist/LICENSE

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ MIT
1515

1616
@actions/io
1717
MIT
18-
The MIT License (MIT)
19-
20-
Copyright 2019 GitHub
21-
22-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
23-
24-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
25-
26-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2718

2819
@azure/ms-rest-azure-env
2920
MIT
@@ -3100,7 +3091,7 @@ pg
31003091
MIT
31013092
MIT License
31023093

3103-
Copyright (c) 2010 - 2021 Brian Carlson
3094+
Copyright (c) 2010 - 2020 Brian Carlson
31043095

31053096
Permission is hereby granted, free of charge, to any person obtaining a copy
31063097
of this software and associated documentation files (the "Software"), to deal
@@ -3191,7 +3182,7 @@ pg-protocol
31913182
MIT
31923183
MIT License
31933184

3194-
Copyright (c) 2010 - 2021 Brian Carlson
3185+
Copyright (c) 2010 - 2020 Brian Carlson
31953186

31963187
Permission is hereby granted, free of charge, to any person obtaining a copy
31973188
of this software and associated documentation files (the "Software"), to deal
@@ -4208,7 +4199,8 @@ MIT
42084199

42094200
underscore
42104201
MIT
4211-
Copyright (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
4202+
Copyright (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative
4203+
Reporters & Editors
42124204

42134205
Permission is hereby granted, free of charge, to any person
42144206
obtaining a copy of this software and associated documentation

0 commit comments

Comments
 (0)