From 323e10a2f86b8b168c5b3731d3a4718c68d19b5d Mon Sep 17 00:00:00 2001 From: Suraj Kumar Adhikari Date: Tue, 13 Jul 2021 22:46:29 +0200 Subject: [PATCH] Increase page limit size to return more records from cloudflare --- .gitignore | 1 + main.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/main.js b/main.js index f4bd78e..f499d57 100644 --- a/main.js +++ b/main.js @@ -11,12 +11,13 @@ const pr = event.pull_request ? event.pull_request.number : "?"; let res; let result; let id = process.env.INPUT_ID; +let perPage = process.env.PER_PAGE ? process.env.PER_PAGE : "100"; if (!id) { result = cp.spawnSync("curl", [ ...["--header", `Authorization: Bearer ${process.env.INPUT_TOKEN}`], ...["--header", "Content-Type: application/json"], - `https://api.cloudflare.com/client/v4/zones/${process.env.INPUT_ZONE}/dns_records`, + `https://api.cloudflare.com/client/v4/zones/${process.env.INPUT_ZONE}/dns_records?per_page=${perPage}`, ]); if (result.status !== 0) {