make getActionContext require process.env.GITHUB_EVENT_PATH (#32509)
This commit is contained in:
3
.github/actions/lib/action-context.js
vendored
3
.github/actions/lib/action-context.js
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user