From b9959faff57e08d09ac67336f71dcbcf7c1374c2 Mon Sep 17 00:00:00 2001 From: "Daniel I. Kelley" Date: Fri, 24 Oct 2025 18:52:43 +0100 Subject: [PATCH 1/2] incremented version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ce5b3b0..85ab168 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aguilita1/github-script-post-comment", - "version": "1.1.1", + "version": "1.1.2", "description": "GitHub Action to run custom JavaScript and post results to GitHub summary and Pull Request", "author": "Daniel I. Kelley", "license": "MIT", From e3e8c9f4583e8b5ff074553b154494b7379ab3a1 Mon Sep 17 00:00:00 2001 From: "Daniel I. Kelley" Date: Fri, 24 Oct 2025 18:57:52 +0100 Subject: [PATCH 2/2] added pull request write permission; switch error.status since error.code deprecated --- .github/workflows/ci.yml | 1 + action.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c2dcb6..ad5072f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: permissions: contents: read + pull-requests: write jobs: lint-and-test: diff --git a/action.yml b/action.yml index 7711c26..5e2971c 100644 --- a/action.yml +++ b/action.yml @@ -143,7 +143,7 @@ runs: console.error(`❌ Error processing ${{ inputs.label }} results:`, error); // Detect when user forgot to return a value (causing body = undefined) - if (error.code === 'ERR_INVALID_ARG_TYPE' && /The "data" argument must be of type string/i.test(error.message)) { + if (error.status === 'ERR_INVALID_ARG_TYPE' && /The "data" argument must be of type string/i.test(error.message)) { console.error(`💡 Hint: Your script returned a non-string value (e.g., object, array, or undefined) — or nothing at all.\n` + `Please return a string, or serialize your result using JSON.stringify.\n\n` + `For example:\n\n`