Skip to content

Commit 9d041cc

Browse files
committed
Merge branch 'dev' into releases/v2
2 parents e2e85c2 + b705c34 commit 9d041cc

File tree

5 files changed

+275
-251
lines changed

5 files changed

+275
-251
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
folder: fetch-api-data-custom
4747
target-folder: data
4848
ssh-key: ${{ secrets.DEPLOY_KEY }}
49-
49+
5050
refresh-api-data-modified-formatting-encoding:
5151
runs-on: ubuntu-latest
5252
needs: refresh-api-data
@@ -86,7 +86,6 @@ jobs:
8686
run: |
8787
echo "Output: ${{ steps.validate.outputs.fetchApiData }}"
8888
89-
9089
- name: Build and Deploy Repo 🚀
9190
uses: JamesIves/github-pages-deploy-action@v4
9291
with:

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,9 @@ The following configuration options should be set.
190190
| `token-configuration` | Any applicable configuration settings that should be set such as authentication tokens. You can reference secrets using the `${{ secrets.secret_name }}` syntax. For more information refer to the [Fetch API documentation](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). | `secrets / with` | **No** |
191191
| `retry` | If you're working with an intermittent API you can toggle this option to `true`. Doing so will make the action try the request 3 times at random intervals before failing. | `with` | **No** |
192192
| `save-location` | By default the save location of the file is `fetch-api-data-action/data.json`, if you'd like to override the directory you can do so by specifying a new one with this variable. | `with` | **No** |
193-
| `save-name` | You can override the name of the exported `.json` file by specifying a new one here. You should _not_ include the file extension in your name. | `with` | **No** |
194-
| `set-output` | Determines if the returned data should be saved as an environment variable or not. This field defaults to `true`, but depending on your API response length you may need to toggle this. If `true`, an environment variable named `fetchApiData` will be created. | `with` | **No** |
193+
| `save-name` | You can override the name of the exported `.json` file by specifying a new one here. You should _not_ include the file extension in your name. |
194+
| `variable-name` | Adjusts the name of the environment variable the action generates so long as `set-output` is `true`. Defaults to `fetchApiData`. | `with` | **No** |
195+
| `set-output` | Determines if the returned data should be saved as an environment variable or not. This field defaults to `true`, but depending on your API response length you may need to toggle this. If `true`, an environment variable and action step output named `fetchApiData` will be created. | `with` | **No** |
195196
| `format` | Allows you to modify the extension of the file saved from the API response, for example you can set this field to `json` or `txt`. This field defaults to `json`. | `with` | **No** |
196197
| `encoding` | Allows you to modify the encoding of the file saved from the API response, for example you can set this field to `utf8` or `hex`. This field defaults to `utf8`. Choose from `ascii`, `utf8`, `utf-8`, `utf16le`, `ucs2`, `ucs-2`, `base64`, `latin1`, `binary` or `hex`. | `with` | **No** |
197198
| `debug` | If set to `true` the action will log the API responses it receives in the terminal. | `with` | **No** |

__tests__/fetch.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {retrieveData, generateExport} from '../src/fetch'
22
import nock from 'nock'
33

4-
jest.setTimeout(60000)
4+
jest.setTimeout(1000000)
55

66
describe('fetch', () => {
77
describe('retrieveData', () => {
@@ -113,7 +113,7 @@ describe('fetch', () => {
113113
data: '{"bestCat":"montezuma"}',
114114
setOutput: true
115115
})
116-
expect(process.env['fetch-api-data']).toBe('{"bestCat":"montezuma"}')
116+
expect(process.env['fetchApiData']).toBe('{"bestCat":"montezuma"}')
117117
})
118118

119119
it('should save non standard file types', async () => {
@@ -124,7 +124,7 @@ describe('fetch', () => {
124124
saveName: 'montezuma',
125125
setOutput: true
126126
})
127-
expect(process.env['fetch-api-data']).toBe('hello')
127+
expect(process.env['fetchApiData']).toBe('hello')
128128
})
129129

130130
it('should save the file with customized file location/names', async () => {
@@ -134,7 +134,7 @@ describe('fetch', () => {
134134
saveName: 'montezuma',
135135
setOutput: true
136136
})
137-
expect(process.env['fetch-api-data']).toBe('{"bestCat":"montezuma"}')
137+
expect(process.env['fetchApiData']).toBe('{"bestCat":"montezuma"}')
138138
})
139139

140140
it('should save file with custom encoding', async () => {
@@ -145,7 +145,7 @@ describe('fetch', () => {
145145
saveName: 'hex-data',
146146
setOutput: true
147147
})
148-
expect(process.env['fetch-api-data']).toBe('68656C6C6F21')
148+
expect(process.env['fetchApiData']).toBe('68656C6C6F21')
149149
})
150150

151151
it('should fail if invalid encoding is used', async () => {

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"github-action"
3636
],
3737
"dependencies": {
38-
"@actions/core": "1.9.1",
38+
"@actions/core": "1.10.0",
3939
"@actions/io": "1.1.2",
4040
"async-retry": "1.3.3",
4141
"cross-fetch": "3.1.5",
@@ -44,18 +44,18 @@
4444
"devDependencies": {
4545
"@types/async-retry": "1.4.3",
4646
"@types/jest": "27.5.0",
47-
"@types/mustache": "4.2.1",
48-
"@types/node": "18.11.10",
49-
"@typescript-eslint/eslint-plugin": "5.43.0",
50-
"@typescript-eslint/parser": "5.20.0",
51-
"eslint": "8.24.0",
47+
"@types/mustache": "4.2.2",
48+
"@types/node": "20.5.7",
49+
"@typescript-eslint/eslint-plugin": "5.62.0",
50+
"@typescript-eslint/parser": "5.54.1",
51+
"eslint": "8.48.0",
5252
"eslint-config-prettier": "8.5.0",
53-
"eslint-plugin-jest": "27.1.1",
53+
"eslint-plugin-jest": "27.2.1",
5454
"eslint-plugin-prettier": "4.2.1",
5555
"jest": "27.5.1",
5656
"jest-circus": "27.5.1",
5757
"nock": "13.2.9",
58-
"prettier": "2.7.1",
58+
"prettier": "2.8.4",
5959
"ts-jest": "27.1.4",
6060
"typescript": "4.9.3"
6161
}

0 commit comments

Comments
 (0)