Skip to content

Models

Data models for GitHub API payloads, all annotated with @Serializable for JSON deserialization.


Repository

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/Repository.kt

Represents a GitHub repository. Available on all ActionContext types.

Key Properties

Property Type Description
id Int Repository ID
name String Repository name
fullName String Owner/name (e.g., "octocat/hello-world")
owner User Repository owner
defaultBranch String Default branch name
private Boolean Whether the repository is private
description String? Repository description
language String? Primary language
htmlUrl String Web URL
cloneUrl String HTTPS clone URL
createdAt Instant Creation timestamp
pushedAt Instant? Last push timestamp
stargazersCount Int Number of stars
forksCount Int Number of forks
openIssuesCount Int Number of open issues
topics List<String> Repository topics
license License? Repository license

Nested: License

Property Type Description
key String License key (e.g., "mit")
name String License name
spdxId String? SPDX identifier

Issue

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/Issue.kt

Represents a GitHub issue.

Key Properties

Property Type Description
id Long Issue ID
number Int Issue number
title String Issue title
body String? Issue body text
state String "open" or "closed"
stateReason String? Why the issue was closed
user User Issue author
labels List<Label> Applied labels
assignee Assignee? Single assignee
assignees List<Assignee> All assignees
milestone Milestone? Associated milestone
comments Int Number of comments
createdAt Instant Creation timestamp
updatedAt Instant Last update timestamp
closedAt Instant? Closure timestamp
reactions Reactions Reaction counts
authorAssociation UserAssociation Author's relationship to the repo

Nested: Label

Property Type Description
id Long Label ID
name String Label name
color String Label color (hex without #)
description String Label description
default Boolean Whether it's a default label

Nested: Reactions

Property Type Description
totalCount Int Total reaction count
p1 Int 👍 count
m1 Int 👎 count
laugh Int 😄 count
confused Int 😕 count
heart Int ❤️ count
hooray Int 🎉 count
rocket Int 🚀 count
eyes Int 👀 count

PullRequest

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/PullRequest.kt

Represents a GitHub pull request.

Key Properties

Property Type Description
id Long PR ID
number Int PR number
title String PR title
body String? PR description
state String "open" or "closed"
draft Boolean Whether it's a draft
merged Boolean Whether it was merged
user User PR author
head Head Head branch info
base Base Base branch info
additions Int Lines added
deletions Int Lines deleted
changedFiles Int Number of changed files
commits Int Number of commits
comments Int Number of comments
reviewComments Int Number of review comments
labels List<Label> Applied labels
requestedReviewers List<User> Requested reviewers
milestone Milestone? Associated milestone

Nested: Head / Base

Property Type Description
ref String Branch name
sha String Commit SHA
label String Label (e.g., "user:branch")
repo Repository The repository
user User Branch owner

Commit

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/Commit.kt

Represents a commit in a push event.

Property Type Description
id String Commit SHA
message String Commit message
timestamp Instant Commit timestamp
author Actor Commit author
committer Actor Commit committer
distinct Boolean Whether this is a distinct commit
url String Commit URL
treeId String Tree SHA

HeadCommit

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/HeadCommit.kt

Same structure as Commit. Represents the head commit of a push event.


Release

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/Release.kt

Represents a GitHub release.

Key Properties

Property Type Description
id Int Release ID
name String Release name
tagName String Tag name
body String Release notes
draft Boolean Whether it's a draft
prerelease Boolean Whether it's a pre-release
author User Release author
targetCommitish String Target branch/commit
createdAt Instant Creation timestamp
publishedAt Instant Publication timestamp
assets List<Asset> Release assets

Nested: Asset

Property Type Description
id Int Asset ID
name String File name
size Int File size in bytes
downloadCount Int Download count
contentType String MIME type
browserDownloadUrl String Download URL
uploader User Who uploaded the asset

Common Types

User

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/common/User.kt

Property Type Description
id Int User ID
login String Username
type AccountType User, Organization, or Bot
siteAdmin Boolean Whether the user is a site admin
avatarUrl String Avatar image URL
htmlUrl String Profile URL

Actor

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/common/Actor.kt

Property Type Description
name String Display name
email String Email address
username String? GitHub username (nullable)

Enums

RefType

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/RefType.kt

BRANCH or TAG

PusherType

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/PusherType.kt

USER or DEPLOY_KEY

AccountType

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/common/AccountType.kt

User, Organization, or Bot

UserAssociation

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/common/UserAssociation.kt

OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, FIRST_TIME_CONTRIBUTOR, FIRST_TIMER, NONE, UNKNOWN


Change

Source: core/src/main/kotlin/ir/amirroid/workflowkt/models/Change.kt

Represents a field change in an issue edit event.

data class Change(val from: String)

typealias Changes = Map<String, Change>