From 1d2a8aff4aecfbb8a3e56f4b7b6ecd7867a8c1fd Mon Sep 17 00:00:00 2001 From: Nicolas Forgeot Date: Wed, 23 Oct 2024 14:24:40 +0200 Subject: [PATCH] feat: hide manifest in logs --- index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index b50cc0b..bedee2b 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ import core from '@actions/core' -import { $, fs, cd } from 'zx' +import { $, fs, cd, fetch } from 'zx' void async function main() { try { @@ -86,7 +86,12 @@ async function dep() { throw new Error('Deployer binary not found. Please specify deployer-binary or deployer-version.') } version = version.replace(/^v/, '') - let manifest = JSON.parse((await $`curl -L https://deployer.org/manifest.json`).stdout) + const response = await fetch(`https://deployer.org/manifest.json`) + if (!response.ok) { + const body = await response.text() + throw new Error(`Manifest can be downloaded. ${response.status} ${body}`) + } + let manifest = await response.json() let url for (let asset of manifest) { if (asset.version === version) { @@ -124,7 +129,7 @@ async function dep() { } catch (e) { console.error('Invalid JSON in options') } - + let phpBin = 'php' let phpBinArg = core.getInput('php-binary'); if (phpBinArg !== '') {