-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
action.yml
62 lines (50 loc) · 2.92 KB
/
action.yml
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
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 <[email protected]>'
runs:
using: 'node20'
main: 'lib/main.js'
branding:
icon: 'truck'
color: 'purple'
inputs:
endpoint:
description: 'The URL of the endpoint you would like to retrieve data from.'
required: true
configuration:
description: 'Any applicable configuration settings that should be set such as authentication tokens. You can reference secrets using the secrets syntax, or you can reference data returned from the `TOKEN_ENDPOINT` request using the triple bracket syntax.'
required: false
token-endpoint:
description: '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.'
required: false
token-configuration:
description: 'Any applicable configuration settings that should be set such as authentication tokens. You can reference secrets using the secrets syntax.'
required: false
retry:
description: 'If you are 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.'
required: false
save-location:
description: 'By default the save location of the JSON file is `fetch-api-data-action/data.json`, if you would like to override the directory you can do so by specifying a new one with this variable.'
required: false
save-name:
description: '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.'
required: false
variable-name:
description: 'You can override the name of the variable name the action exports. This will work so long as set-output is true.'
required: false
set-output:
description: '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.'
required: false
default: 'true'
debug:
description: 'If set to true the action will log the API responses it receives in the terminal.'
required: false
format:
description: 'Allows you to modify the format of the saved file, for example you can use txt here to save the file as a txt file. This field defaults to json.'
required: false
encoding:
description: 'Allows you to specify the encoding the saved file, can be of type BufferEncoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex".'
required: false
outputs:
fetchApiData:
description: 'The requested data from the API stored as a string.'