Skip to content

Commit 40dfcf4

Browse files
author
Irene Alvarado
committed
fix: update readme
1 parent 9a17f4e commit 40dfcf4

File tree

5 files changed

+241128
-244299
lines changed

5 files changed

+241128
-244299
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,29 @@ For example, if this field is set to `Bearer abc123` then the following header i
101101
}
102102
```
103103

104-
And in the action yaml:
105-
`authorization: 'Bearer abc123'`
104+
#### `axios_config` (optional)
105+
106+
Under the hood, the `http` backend uses [Axios](https://github.com/axios/axios) for data fetching. By default, Flat assumes you're interested in using the `GET` method to fetch data, but if you'd like to `POST` (e.g., sending a GraphQL query), the `axios_config` option allows you to override this behavior.
107+
108+
Specifically, the `axios_config` parameter should reflect a relative path to a `.json` file in your repository. This JSON file should mirror the shape of [Axios' request config parameters](https://github.com/axios/axios#request-config), with a few notable exceptions.
109+
110+
- `url` and `baseURL` will both be ignored, as the `http_url` specified above will take precedence.
111+
- `headers` will be merged in with the authorization header described by the `authorization` parameter above. Please do not put secret keys here, as they will be stored in plain text!
112+
- All `function` parameters will be ignored (e.g., `transformRequest`).
113+
- The response type is always set to `responseType: 'stream'` in the background.
114+
115+
An example `axios_config` might look thusly if you were interested in hitting GitHub's GraphQL API ([here is a demo](https://github.com/githubocto/flat-demo-graphql)) 👇
116+
117+
```json
118+
{
119+
"method": "post",
120+
"data": {
121+
"query": "query { repository(owner:\"octocat\", name:\"Hello-World\") { issues(last:20, states:CLOSED) { edges { node { title url labels(first:5) { edges { node { name } } } } } } } }"
122+
}
123+
}
124+
```
125+
126+
We advise escaping double quotes like `\"` in your JSON file.
106127

107128
#### `downloaded_filename`
108129

dist/LICENSE

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ 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.
1827

1928
@azure/ms-rest-azure-env
2029
MIT
@@ -3091,7 +3100,7 @@ pg
30913100
MIT
30923101
MIT License
30933102

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

30963105
Permission is hereby granted, free of charge, to any person obtaining a copy
30973106
of this software and associated documentation files (the "Software"), to deal
@@ -3182,7 +3191,7 @@ pg-protocol
31823191
MIT
31833192
MIT License
31843193

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

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

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

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

0 commit comments

Comments
 (0)