Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Improve OS types and docs
  • Loading branch information
henrymercer committed May 15, 2026
commit 931147e852fc8f5eea6a5ee734f426c164a34ddb
15 changes: 13 additions & 2 deletions pr-checks/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,21 @@ interface WorkflowInput {
/** A partial mapping from known input names to input definitions. */
type WorkflowInputs = Partial<Record<KnownInputName, WorkflowInput>>;

/** An operating system identifier. */
type OperatingSystemIdentifier = "ubuntu" | "macos" | "windows";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!


/**
* Represents an operating system matrix entry for a generated PR check workflow.
*
* Either a string containing the OS identifier or an object containing the OS identifier and an
* optional runner image label.
*/
type OperatingSystem =
| string
| OperatingSystemIdentifier
| {
os: string;
/** OS identifier. */
os: OperatingSystemIdentifier;
/** Optional runner image label. */
"runner-image"?: string;
};
Comment on lines +40 to +47

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: JSDocs? Perhaps rather than having the extended description below, move some of that here and then simplify the doc for operatingSystems.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wonder if having both os and runner-image is a bit redundant since runner-image typically starts with the os string, so you could infer os from runner-image when that's specified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added JSDoc and a more specific type for os. You're right that we could probably infer runner-image but there's no guarantee about the structure of the labels in general so I'll leave this as is.


Expand Down
Loading