-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
35 lines (30 loc) · 834 Bytes
/
index.js
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
import core from '@actions/core'
import kv from './cloudflare.js'
async function run() {
try {
const accountId = process.env.CLOUDFLARE_ACCOUNT_ID
const apiKey = process.env.CLOUDFLARE_API_KEY
const accountEmail = process.env.CLOUDFLARE_ACCOUNT_EMAIL
const namespaceId = core.getInput('namespace_identifier')
const key = core.getInput('key_name')
const value = core.getInput('value')
const expirationTtl = core.getInput('expiration_ttl')
const expiration = core.getInput('expiration')
const returnValue = await kv(
accountId,
accountEmail,
apiKey,
namespaceId,
key,
value,
expiration,
expirationTtl
)
if (returnValue) {
core.setOutput('value', returnValue)
}
} catch (error) {
core.setFailed(error.message)
}
}
run()