From 8e451d4365aa8b62e0a59891cdaeee707964e0ad Mon Sep 17 00:00:00 2001 From: Emilien Devos <4016501+unixfox@users.noreply.github.com> Date: Mon, 22 Apr 2024 00:20:29 +0200 Subject: [PATCH] trying to add the new check to the status page --- .github/workflows/add-instance-updown.yml | 8 ++++++-- .github/workflows/add-instance-uptimerobot.yml | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add-instance-updown.yml b/.github/workflows/add-instance-updown.yml index 68d1cde..fa7c904 100644 --- a/.github/workflows/add-instance-updown.yml +++ b/.github/workflows/add-instance-updown.yml @@ -54,6 +54,7 @@ jobs: var request = require("request"); var optionsAddNewCheck = { method: 'POST', url: 'https://updown.io/api/checks?api-key=${{ secrets.UPDOWN_API_KEY }}', + json:true, headers: { 'content-type': 'application/x-www-form-urlencoded' }, form: @@ -71,7 +72,8 @@ jobs: if (body.token) { var optionsGetStatusPages = { method: 'GET', - url: 'https://updown.io/api/status_pages?api-key=${{ secrets.UPDOWN_API_KEY }}' + url: 'https://updown.io/api/status_pages?api-key=${{ secrets.UPDOWN_API_KEY }}', + json: true }; request(optionsGetStatusPages, async function (error, response, body) { @@ -87,11 +89,13 @@ jobs: headers: { 'content-type': 'application/json' }, - json: {checks: checksOfStatusPage} + json: {checks: checksOfStatusPage}) }; request(optionsAddCheckToStatusPage, async function (error, response, body) { if (error) throw new Error(error); + + console.log(body) }); }); diff --git a/.github/workflows/add-instance-uptimerobot.yml b/.github/workflows/add-instance-uptimerobot.yml index 3053407..9d1b9f3 100644 --- a/.github/workflows/add-instance-uptimerobot.yml +++ b/.github/workflows/add-instance-uptimerobot.yml @@ -54,6 +54,7 @@ jobs: var request = require("request"); var options = { method: 'POST', url: 'https://api.uptimerobot.com/v2/newMonitor', + json:true, headers: { 'content-type': 'application/x-www-form-urlencoded', 'cache-control': 'no-cache' },