event.ts
This file
Path
apps/platform/src/workflows/on-push/event.ts
40 lines · 1.0 KiB · TypeScript
Last changed by
Merge build/comments-platform into mainoscabrielbefore adoptionddf09e8
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 1–40why, one step back1import { CommitSha, RepoName } from "@repo/protocol/ids";2import { Schema } from "effect";34const GitIdentity = Schema.Struct({5 email: Schema.String,6 name: Schema.String,7});89const PushedCommit = Schema.Struct({10 author: GitIdentity,11 committer: GitIdentity,12 id: CommitSha,13 message: Schema.String,14 messageTruncated: Schema.Boolean,15 parents: Schema.Array(CommitSha),16 timestamp: Schema.DateTimeUtcFromString,17});1819export const OnPushEvent = Schema.Struct({20 id: Schema.NonEmptyString,21 payload: Schema.Struct({22 after: CommitSha,23 before: CommitSha,24 commits: Schema.Array(PushedCommit),25 commitsTruncated: Schema.Boolean,26 ref: Schema.NonEmptyString,27 totalCommitsCount: Schema.Int,28 }),29 source: Schema.Struct({30 namespace: Schema.NonEmptyString,31 repoName: RepoName,32 }),33 type: Schema.Literal("cf.artifacts.repo.pushed"),34});3536export type OnPushEvent = typeof OnPushEvent.Type;3738export const ZeroSha = CommitSha.make("0".repeat(40));3940export const isZero = (sha: CommitSha): boolean => sha === ZeroSha;