Skip to content

Commit eb8e246

Browse files
authored
Update main.js
Fixed usage of `dns_records?name` param
1 parent 686e817 commit eb8e246

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
const cp = require("child_process");
77

88
const getCurrentRecordId = () => {
9+
const params = new URLSearchParams({
10+
name: process.env.INPUT_NAME,
11+
});
12+
913
//https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
1014
const { status, stdout } = cp.spawnSync("curl", [
1115
...["--header", `Authorization: Bearer ${process.env.INPUT_TOKEN}`],
1216
...["--header", "Content-Type: application/json"],
13-
`https://api.cloudflare.com/client/v4/zones/${process.env.INPUT_ZONE}/dns_records?name=${process.env.INPUT_NAME}`,
17+
`https://api.cloudflare.com/client/v4/zones/${process.env.INPUT_ZONE}/dns_records?${params.toString()}`,
1418
]);
1519

1620
if (status !== 0) {

0 commit comments

Comments
 (0)