Skip to content

Commit

Permalink
Merge branch 'dev' into releases/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Oct 13, 2022
2 parents 4a1676b + 3180b04 commit 9f7b9a2
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 117 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 'v14.18.1'
node-version: 16
registry-url: 'https://registry.npmjs.org'

- name: Install Yarn
Expand All @@ -33,6 +33,6 @@ jobs:
yarn test
- name: Uploade CodeCov Report
uses: codecov/codecov-action@v3.1.0
uses: codecov/codecov-action@v3.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 'v14.18.1'
node-version: 16
registry-url: 'https://registry.npmjs.org'

- name: Install Yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: 'v14.18.1'
node-version: 16
registry-url: 'https://registry.npmjs.org'
scope: '@jamesives'

Expand All @@ -42,7 +42,7 @@ jobs:
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
registry-url: 'https://npm.pkg.github.com'
scope: '@jamesives'

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
file: 'README.md'
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="50px" alt="{{{ login }}}" /></a>&nbsp;&nbsp;'
maximum: 9999
organization: true

- name: Generate Sponsors 💖
uses: JamesIves/github-sponsors-readme-action@v1
Expand All @@ -28,7 +27,6 @@ jobs:
minimum: 10000
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="80px" alt="{{{ login }}}" /></a>&nbsp;&nbsp;'
marker: 'premium'
organization: true

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
</p>

<p align="center">
Maintainence of this project is made possible by all the <a href="https://github.com/JamesIves/github-pages-deploy-action/graphs/contributors">contributors</a> and <a href="https://github.com/sponsors/JamesIves">sponsors</a>. If you'd like to sponsor this project and have your avatar or company logo appear below <a href="https://github.com/sponsors/JamesIves">click here</a>. 💖
Maintenance of this project is made possible by all the <a href="https://github.com/JamesIves/github-pages-deploy-action/graphs/contributors">contributors</a> and <a href="https://github.com/sponsors/JamesIves">sponsors</a>. If you'd like to sponsor this project and have your avatar or company logo appear below <a href="https://github.com/sponsors/JamesIves">click here</a>. 💖
</p>

<p align="center">
<!-- premium --><a href="https://github.com/github"><img src="https://github.com/github.png" width="80px" alt="github" /></a>&nbsp;&nbsp;<!-- premium -->
<!-- premium --><!-- premium -->
</p>

<p align="center">
<!-- sponsors --><a href="https://github.com/Chooksta69"><img src="https://github.com/Chooksta69.png" width="50px" alt="Chooksta69" /></a>&nbsp;&nbsp;<a href="https://github.com/robjtede"><img src="https://github.com/robjtede.png" width="50px" alt="robjtede" /></a>&nbsp;&nbsp;<a href="https://github.com/hadley"><img src="https://github.com/hadley.png" width="50px" alt="hadley" /></a>&nbsp;&nbsp;<a href="https://github.com/kevinchalet"><img src="https://github.com/kevinchalet.png" width="50px" alt="kevinchalet" /></a>&nbsp;&nbsp;<a href="https://github.com/Yousazoe"><img src="https://github.com/Yousazoe.png" width="50px" alt="Yousazoe" /></a>&nbsp;&nbsp;<!-- sponsors -->
<!-- sponsors --><a href="https://github.com/Chooksta69"><img src="https://github.com/Chooksta69.png" width="50px" alt="Chooksta69" /></a>&nbsp;&nbsp;<a href="https://github.com/robjtede"><img src="https://github.com/robjtede.png" width="50px" alt="robjtede" /></a>&nbsp;&nbsp;<a href="https://github.com/hadley"><img src="https://github.com/hadley.png" width="50px" alt="hadley" /></a>&nbsp;&nbsp;<a href="https://github.com/kevinchalet"><img src="https://github.com/kevinchalet.png" width="50px" alt="kevinchalet" /></a>&nbsp;&nbsp;<!-- sponsors -->
</p>

## Getting Started ✈️
Expand Down Expand Up @@ -188,7 +188,7 @@ The following configuration options should be set.
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -------- |
| `token-endpoint` | If the `endpoint` API requires you to make a request to get an access token prior to fetching data you can perform this task by specifying a token endpoint. Any data returned from the token end can be referenced in the `configuration` variable using the triple bracket syntax: `{{{ access_token }}}`. For more information refer to the [Token Request part of the readme](https://github.com/JamesIves/fetch-api-data-action#token-request-%EF%B8%8F); | `with` | **No** |
| `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** |
| `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 invervals before failing. | `with` | **No** |
| `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** |
| `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** |
| `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** |
| `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. | `with` | **No** |
Expand Down
4 changes: 2 additions & 2 deletions __tests__/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('fetch', () => {
})
} catch (error) {
expect(error instanceof Error && error.message).toBe(
"There was an error fetching from the API: TypeError: Cannot read property 'cat' of null ❌"
"There was an error fetching from the API: TypeError: Cannot read properties of null (reading 'cat') ❌"
)
}
})
Expand Down Expand Up @@ -159,7 +159,7 @@ describe('fetch', () => {
})
} catch (error) {
expect(error instanceof Error && error.message).toBe(
`There was an error generating the export file: TypeError [ERR_INVALID_OPT_VALUE_ENCODING]: The value "hexxxxx" is invalid for option "encoding" ❌`
"There was an error generating the export file: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'hexxxxx' is invalid encoding. Received 'encoding' ❌"
)
}
})
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Fetch API Data'
description: 'This action will handle authenticated API requests, allowing you to save the data from the request into your workspace.'
author: 'James Ives <iam@jamesiv.es>'
runs:
using: 'node12'
using: 'node16'
main: 'lib/main.js'
branding:
icon: 'truck'
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@jamesives/fetch-api-data-action",
"description": "GitHub action for handling authenticated API requests, allowing you to save the data from the request into your workspace as an environment variable and a .json file.",
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)",
"version": "2.2.2",
"version": "2.2.3",
"license": "MIT",
"main": "lib/lib.js",
"types": "lib/lib.d.ts",
Expand Down Expand Up @@ -35,7 +35,7 @@
"github-action"
],
"dependencies": {
"@actions/core": "1.9.0",
"@actions/core": "1.9.1",
"@actions/io": "1.1.2",
"async-retry": "1.3.3",
"cross-fetch": "3.1.5",
Expand All @@ -44,19 +44,19 @@
"devDependencies": {
"@types/async-retry": "1.4.3",
"@types/jest": "27.5.0",
"@types/mustache": "4.1.2",
"@types/node": "18.0.0",
"@types/mustache": "4.2.1",
"@types/node": "18.8.3",
"@typescript-eslint/eslint-plugin": "5.20.0",
"@typescript-eslint/parser": "5.20.0",
"eslint": "8.18.0",
"eslint": "8.24.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-jest": "26.5.3",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-jest": "27.1.1",
"eslint-plugin-prettier": "4.2.1",
"jest": "27.5.1",
"jest-circus": "27.5.1",
"nock": "13.2.4",
"nock": "13.2.9",
"prettier": "2.7.1",
"ts-jest": "27.1.4",
"typescript": "4.7.4"
"typescript": "4.8.4"
}
}
Loading

0 comments on commit 9f7b9a2

Please sign in to comment.