From ba17a4eefc49ba1e9d5c70aa6fc7ef5cb44c7eba Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 10 Nov 2022 17:56:33 +0100 Subject: [PATCH] make getActionContext require process.env.GITHUB_EVENT_PATH (#32509) --- .github/actions/lib/action-context.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/lib/action-context.js b/.github/actions/lib/action-context.js index 137abec732..5eadd2f200 100644 --- a/.github/actions/lib/action-context.js +++ b/.github/actions/lib/action-context.js @@ -2,6 +2,9 @@ import { readFileSync } from 'fs' // Parses the action event payload sets repo and owner to an object from runner environment export function getActionContext() { + if (!process.env.GITHUB_EVENT_PATH) { + throw new Error('process.env.GITHUB_EVENT_PATH is not set') + } const context = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')) if (context.repository) { context.owner = context.repository.owner.login