Skip to content

Commit

Permalink
Merge pull request #276 from pixeleye-io/test
Browse files Browse the repository at this point in the history
Update compare.tsx
  • Loading branch information
AlfieJones authored Apr 11, 2024
2 parents e556c1f + e2eb487 commit f8e3dee
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-spoons-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pixeleye/cli-env": minor
---

Reading github action payload
23 changes: 20 additions & 3 deletions integrations/cli/cli-env/src/services/github.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
/* eslint-disable turbo/no-undeclared-env-vars */
import { CiEnv } from "env-ci";
import { getCommit } from "../git";
import { existsSync, readFileSync } from "fs";

interface GithubPayload {
pull_request?: {
head: {
sha: string;
ref: string;
};
number: number;
};
}

export async function getGithubEnv(env: CiEnv): Promise<CiEnv> {
const commitSha = await getCommit();
console.log("SHA: ", commitSha);
let payload: GithubPayload = {};
if (
process.env.GITHUB_EVENT_PATH &&
existsSync(process.env.GITHUB_EVENT_PATH)
) {
payload = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
}

return {
...env,
prBranch: process.env.GITHUB_HEAD_REF,
commit: commitSha || env.commit,
commit: payload.pull_request?.head.sha || env.commit,
};
}
1 change: 0 additions & 1 deletion libs/reviewer/src/compare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const buttonHoverColors: Record<Snapshot["status"], string> = {
unchanged: "",
}


function ReviewDropdown({ snapshots, canReview, onReview }: { snapshots: DiffGroupedSnapshotTargetGroups; canReview: boolean; onReview: (status: Snapshot["status"]) => void }) {

return (
Expand Down

0 comments on commit f8e3dee

Please sign in to comment.