Skip to content

Commit

Permalink
Grab github variable from env
Browse files Browse the repository at this point in the history
  • Loading branch information
iljadaderko authored Aug 19, 2019
1 parent 55b75f3 commit 178fb30
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/ci_source/providers/GitHubActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ import { readFileSync, existsSync } from "fs"
*
*/

const eventFilePath = process.env.GITHUB_EVENT_PATH || "/github/workflow/event.json"

export class GitHubActions implements CISource {
private event: any

constructor(private readonly env: Env) {
const { GITHUB_EVENT_PATH } = env
const eventFilePath = GITHUB_EVENT_PATH || "/github/workflow/event.json"

if (existsSync(eventFilePath)) {
const event = readFileSync(eventFilePath, "utf8")
this.event = JSON.parse(event)
Expand Down

0 comments on commit 178fb30

Please sign in to comment.