import * as actions from "./actions" import * as triggers from "./triggers" import { defineAccount } from "../../automation/integrations" /** Declares a named GitHub App installation binding for an automation. */ export const githubAccount = defineAccount("github") /** Removes the provider qualifier from GitHub callable export names. */ type GitHubCallableMap = { [Key in keyof Exports as Key extends `${infer Prefix}GitHub${infer Suffix}` ? `${Prefix}${Suffix}` : never]: Exports[Key] } /** GitHub actions, kept separate to bound declaration type inference. */ const githubActions: GitHubCallableMap = { cancelWorkflowRun: actions.cancelGitHubWorkflowRun, createCheckRun: actions.createGitHubCheckRun, createBranch: actions.createGitHubBranch, createCommitStatus: actions.createGitHubCommitStatus, createDeployment: actions.createGitHubDeployment, createDeploymentStatus: actions.createGitHubDeploymentStatus, createIssue: actions.createGitHubIssue, createIssueComment: actions.createGitHubIssueComment, createPullRequest: actions.createGitHubPullRequest, createPullRequestReview: actions.createGitHubPullRequestReview, createPullRequestReviewComment: actions.createGitHubPullRequestReviewComment, createRelease: actions.createGitHubRelease, createOrUpdateRepositoryFile: actions.createOrUpdateGitHubRepositoryFile, createOrUpdateWorkflowFile: actions.createOrUpdateGitHubWorkflowFile, deleteDeployment: actions.deleteGitHubDeployment, deleteBranch: actions.deleteGitHubBranch, deleteIssueComment: actions.deleteGitHubIssueComment, deletePullRequestReviewComment: actions.deleteGitHubPullRequestReviewComment, deleteRelease: actions.deleteGitHubRelease, deleteReleaseAsset: actions.deleteGitHubReleaseAsset, deleteRepositoryFile: actions.deleteGitHubRepositoryFile, deleteWorkflowFile: actions.deleteGitHubWorkflowFile, disableWorkflow: actions.disableGitHubWorkflow, dispatchRepositoryEvent: actions.dispatchGitHubRepositoryEvent, dispatchWorkflow: actions.dispatchGitHubWorkflow, enableWorkflow: actions.enableGitHubWorkflow, getBranch: actions.getGitHubBranch, getCombinedCommitStatus: actions.getGitHubCombinedCommitStatus, getDeployment: actions.getGitHubDeployment, getDeploymentStatus: actions.getGitHubDeploymentStatus, getIssue: actions.getGitHubIssue, getIssueComment: actions.getGitHubIssueComment, getPullRequest: actions.getGitHubPullRequest, getPullRequestReviewComment: actions.getGitHubPullRequestReviewComment, getRelease: actions.getGitHubRelease, getRepository: actions.getGitHubRepository, getRepositoryContent: actions.getGitHubRepositoryContent, getWorkflow: actions.getGitHubWorkflow, getWorkflowRun: actions.getGitHubWorkflowRun, listBranches: actions.listGitHubBranches, listDeploymentStatuses: actions.listGitHubDeploymentStatuses, listDeployments: actions.listGitHubDeployments, listIssueComments: actions.listGitHubIssueComments, listIssues: actions.listGitHubIssues, listPullRequestFiles: actions.listGitHubPullRequestFiles, listPullRequestReviewComments: actions.listGitHubPullRequestReviewComments, listPullRequestReviews: actions.listGitHubPullRequestReviews, listPullRequests: actions.listGitHubPullRequests, listReleases: actions.listGitHubReleases, listReleaseAssets: actions.listGitHubReleaseAssets, listRepositories: actions.listGitHubRepositories, listWorkflowRunJobs: actions.listGitHubWorkflowRunJobs, listWorkflowRuns: actions.listGitHubWorkflowRuns, listWorkflows: actions.listGitHubWorkflows, mergePullRequest: actions.mergeGitHubPullRequest, removePullRequestReviewers: actions.removeGitHubPullRequestReviewers, replyToPullRequestReviewComment: actions.replyToGitHubPullRequestReviewComment, requestPullRequestReviewers: actions.requestGitHubPullRequestReviewers, rerunFailedWorkflowJobs: actions.rerunFailedGitHubWorkflowJobs, rerunWorkflow: actions.rerunGitHubWorkflow, updateIssue: actions.updateGitHubIssue, updateCheckRun: actions.updateGitHubCheckRun, updateIssueComment: actions.updateGitHubIssueComment, updatePullRequest: actions.updateGitHubPullRequest, updatePullRequestBranch: actions.updateGitHubPullRequestBranch, updatePullRequestReviewComment: actions.updateGitHubPullRequestReviewComment, updateRelease: actions.updateGitHubRelease, updateReleaseAsset: actions.updateGitHubReleaseAsset, uploadReleaseAsset: actions.uploadGitHubReleaseAsset, } /** GitHub triggers, kept separate to bound declaration type inference. */ const githubTriggers: GitHubCallableMap = { onCommitCommentCreated: triggers.onGitHubCommitCommentCreated, onCommitCommentEvent: triggers.onGitHubCommitCommentEvent, onBranchCreated: triggers.onGitHubBranchCreated, onBranchDeleted: triggers.onGitHubBranchDeleted, onCheckRunActionRequired: triggers.onGitHubCheckRunActionRequired, onCheckRunCancelled: triggers.onGitHubCheckRunCancelled, onCheckRunCompleted: triggers.onGitHubCheckRunCompleted, onCheckRunCreated: triggers.onGitHubCheckRunCreated, onCheckRunEvent: triggers.onGitHubCheckRunEvent, onCheckRunFailed: triggers.onGitHubCheckRunFailed, onCheckRunNeutral: triggers.onGitHubCheckRunNeutral, onCheckRunPending: triggers.onGitHubCheckRunPending, onCheckRunRerequested: triggers.onGitHubCheckRunRerequested, onCheckRunRequestedAction: triggers.onGitHubCheckRunRequestedAction, onCheckRunSkipped: triggers.onGitHubCheckRunSkipped, onCheckRunStale: triggers.onGitHubCheckRunStale, onCheckRunSucceeded: triggers.onGitHubCheckRunSucceeded, onCheckRunStartupFailed: triggers.onGitHubCheckRunStartupFailed, onCheckRunTimedOut: triggers.onGitHubCheckRunTimedOut, onCheckRunWaiting: triggers.onGitHubCheckRunWaiting, onCheckSuiteActionRequired: triggers.onGitHubCheckSuiteActionRequired, onCheckSuiteCancelled: triggers.onGitHubCheckSuiteCancelled, onCheckSuiteCompleted: triggers.onGitHubCheckSuiteCompleted, onCheckSuiteEvent: triggers.onGitHubCheckSuiteEvent, onCheckSuiteFailed: triggers.onGitHubCheckSuiteFailed, onCheckSuiteNeutral: triggers.onGitHubCheckSuiteNeutral, onCheckSuiteRerequested: triggers.onGitHubCheckSuiteRerequested, onCheckSuiteRequested: triggers.onGitHubCheckSuiteRequested, onCheckSuiteSkipped: triggers.onGitHubCheckSuiteSkipped, onCheckSuiteStale: triggers.onGitHubCheckSuiteStale, onCheckSuiteSucceeded: triggers.onGitHubCheckSuiteSucceeded, onCheckSuiteStartupFailed: triggers.onGitHubCheckSuiteStartupFailed, onCheckSuiteTimedOut: triggers.onGitHubCheckSuiteTimedOut, onDeploymentCreated: triggers.onGitHubDeploymentCreated, onDeploymentErrored: triggers.onGitHubDeploymentErrored, onDeploymentFailed: triggers.onGitHubDeploymentFailed, onDeploymentPending: triggers.onGitHubDeploymentPending, onDeploymentQueued: triggers.onGitHubDeploymentQueued, onDeploymentStarted: triggers.onGitHubDeploymentStarted, onDeploymentStatusEvent: triggers.onGitHubDeploymentStatusEvent, onDeploymentSucceeded: triggers.onGitHubDeploymentSucceeded, onDeploymentProtectionRuleEvent: triggers.onGitHubDeploymentProtectionRuleEvent, onDeploymentProtectionRuleRequested: triggers.onGitHubDeploymentProtectionRuleRequested, onDeploymentReviewApproved: triggers.onGitHubDeploymentReviewApproved, onDeploymentReviewEvent: triggers.onGitHubDeploymentReviewEvent, onDeploymentReviewRejected: triggers.onGitHubDeploymentReviewRejected, onDeploymentReviewRequested: triggers.onGitHubDeploymentReviewRequested, onIssueCommentCreated: triggers.onGitHubIssueCommentCreated, onIssueCommentDeleted: triggers.onGitHubIssueCommentDeleted, onIssueCommentEdited: triggers.onGitHubIssueCommentEdited, onIssueCommentEvent: triggers.onGitHubIssueCommentEvent, onIssueCommentPinned: triggers.onGitHubIssueCommentPinned, onIssueCommentUnpinned: triggers.onGitHubIssueCommentUnpinned, onIssueAssigned: triggers.onGitHubIssueAssigned, onIssueClosed: triggers.onGitHubIssueClosed, onIssueDeleted: triggers.onGitHubIssueDeleted, onIssueDemilestoned: triggers.onGitHubIssueDemilestoned, onIssueEdited: triggers.onGitHubIssueEdited, onIssueEvent: triggers.onGitHubIssueEvent, onIssueFieldAdded: triggers.onGitHubIssueFieldAdded, onIssueFieldRemoved: triggers.onGitHubIssueFieldRemoved, onIssueLabeled: triggers.onGitHubIssueLabeled, onIssueLocked: triggers.onGitHubIssueLocked, onIssueMilestoned: triggers.onGitHubIssueMilestoned, onIssueOpened: triggers.onGitHubIssueOpened, onIssuePinned: triggers.onGitHubIssuePinned, onIssueReopened: triggers.onGitHubIssueReopened, onIssueTransferred: triggers.onGitHubIssueTransferred, onIssueTyped: triggers.onGitHubIssueTyped, onIssueUnassigned: triggers.onGitHubIssueUnassigned, onIssueUnlabeled: triggers.onGitHubIssueUnlabeled, onIssueUnlocked: triggers.onGitHubIssueUnlocked, onIssueUnpinned: triggers.onGitHubIssueUnpinned, onIssueUntyped: triggers.onGitHubIssueUntyped, onIssueDependenciesEvent: triggers.onGitHubIssueDependenciesEvent, onIssueDependencyBlockedByAdded: triggers.onGitHubIssueDependencyBlockedByAdded, onIssueDependencyBlockedByRemoved: triggers.onGitHubIssueDependencyBlockedByRemoved, onIssueDependencyBlockingAdded: triggers.onGitHubIssueDependencyBlockingAdded, onIssueDependencyBlockingRemoved: triggers.onGitHubIssueDependencyBlockingRemoved, onMergeGroupChecksRequested: triggers.onGitHubMergeGroupChecksRequested, onMergeGroupDestroyed: triggers.onGitHubMergeGroupDestroyed, onMergeGroupEvent: triggers.onGitHubMergeGroupEvent, onParentIssueAdded: triggers.onGitHubParentIssueAdded, onParentIssueRemoved: triggers.onGitHubParentIssueRemoved, onPullRequestAssigned: triggers.onGitHubPullRequestAssigned, onPullRequestAutoMergeDisabled: triggers.onGitHubPullRequestAutoMergeDisabled, onPullRequestAutoMergeEnabled: triggers.onGitHubPullRequestAutoMergeEnabled, onPullRequestClosed: triggers.onGitHubPullRequestClosed, onPullRequestConvertedToDraft: triggers.onGitHubPullRequestConvertedToDraft, onPullRequestDemilestoned: triggers.onGitHubPullRequestDemilestoned, onPullRequestDequeued: triggers.onGitHubPullRequestDequeued, onPullRequestEdited: triggers.onGitHubPullRequestEdited, onPullRequestEnqueued: triggers.onGitHubPullRequestEnqueued, onPullRequestEvent: triggers.onGitHubPullRequestEvent, onPullRequestLabeled: triggers.onGitHubPullRequestLabeled, onPullRequestLocked: triggers.onGitHubPullRequestLocked, onPullRequestMerged: triggers.onGitHubPullRequestMerged, onPullRequestMilestoned: triggers.onGitHubPullRequestMilestoned, onPullRequestOpened: triggers.onGitHubPullRequestOpened, onPullRequestReadyForReview: triggers.onGitHubPullRequestReadyForReview, onPullRequestReopened: triggers.onGitHubPullRequestReopened, onPullRequestReviewRequestRemoved: triggers.onGitHubPullRequestReviewRequestRemoved, onPullRequestReviewRequested: triggers.onGitHubPullRequestReviewRequested, onPullRequestReviewApproved: triggers.onGitHubPullRequestReviewApproved, onPullRequestReviewCommentCreated: triggers.onGitHubPullRequestReviewCommentCreated, onPullRequestReviewCommentDeleted: triggers.onGitHubPullRequestReviewCommentDeleted, onPullRequestReviewCommentEdited: triggers.onGitHubPullRequestReviewCommentEdited, onPullRequestReviewCommentEvent: triggers.onGitHubPullRequestReviewCommentEvent, onPullRequestReviewChangesRequested: triggers.onGitHubPullRequestReviewChangesRequested, onPullRequestReviewDismissed: triggers.onGitHubPullRequestReviewDismissed, onPullRequestReviewEdited: triggers.onGitHubPullRequestReviewEdited, onPullRequestReviewEvent: triggers.onGitHubPullRequestReviewEvent, onPullRequestReviewSubmitted: triggers.onGitHubPullRequestReviewSubmitted, onPullRequestReviewThreadEvent: triggers.onGitHubPullRequestReviewThreadEvent, onPullRequestReviewThreadResolved: triggers.onGitHubPullRequestReviewThreadResolved, onPullRequestReviewThreadUnresolved: triggers.onGitHubPullRequestReviewThreadUnresolved, onPullRequestStacked: triggers.onGitHubPullRequestStacked, onPullRequestSynchronized: triggers.onGitHubPullRequestSynchronized, onPullRequestUnassigned: triggers.onGitHubPullRequestUnassigned, onPullRequestUnlabeled: triggers.onGitHubPullRequestUnlabeled, onPullRequestUnlocked: triggers.onGitHubPullRequestUnlocked, onPush: triggers.onGitHubPush, onRefCreated: triggers.onGitHubRefCreated, onRefDeleted: triggers.onGitHubRefDeleted, onReleaseCreated: triggers.onGitHubReleaseCreated, onReleaseDeleted: triggers.onGitHubReleaseDeleted, onReleaseEdited: triggers.onGitHubReleaseEdited, onReleaseEvent: triggers.onGitHubReleaseEvent, onReleasePrereleased: triggers.onGitHubReleasePrereleased, onReleasePublished: triggers.onGitHubReleasePublished, onReleaseReleased: triggers.onGitHubReleaseReleased, onReleaseUnpublished: triggers.onGitHubReleaseUnpublished, onRepositoryDispatch: triggers.onGitHubRepositoryDispatch, onRepositoryArchived: triggers.onGitHubRepositoryArchived, onRepositoryCreated: triggers.onGitHubRepositoryCreated, onRepositoryDeleted: triggers.onGitHubRepositoryDeleted, onRepositoryEdited: triggers.onGitHubRepositoryEdited, onRepositoryEvent: triggers.onGitHubRepositoryEvent, onRepositoryPrivatized: triggers.onGitHubRepositoryPrivatized, onRepositoryPublicized: triggers.onGitHubRepositoryPublicized, onRepositoryRenamed: triggers.onGitHubRepositoryRenamed, onRepositoryTransferred: triggers.onGitHubRepositoryTransferred, onRepositoryUnarchived: triggers.onGitHubRepositoryUnarchived, onStatusErrored: triggers.onGitHubStatusErrored, onStatusEvent: triggers.onGitHubStatusEvent, onStatusFailed: triggers.onGitHubStatusFailed, onStatusPending: triggers.onGitHubStatusPending, onStatusSucceeded: triggers.onGitHubStatusSucceeded, onTagCreated: triggers.onGitHubTagCreated, onTagDeleted: triggers.onGitHubTagDeleted, onSubIssueAdded: triggers.onGitHubSubIssueAdded, onSubIssueRemoved: triggers.onGitHubSubIssueRemoved, onSubIssuesEvent: triggers.onGitHubSubIssuesEvent, onWorkflowDispatch: triggers.onGitHubWorkflowDispatch, onWorkflowJobActionRequired: triggers.onGitHubWorkflowJobActionRequired, onWorkflowJobCancelled: triggers.onGitHubWorkflowJobCancelled, onWorkflowJobCompleted: triggers.onGitHubWorkflowJobCompleted, onWorkflowJobEvent: triggers.onGitHubWorkflowJobEvent, onWorkflowJobFailed: triggers.onGitHubWorkflowJobFailed, onWorkflowJobNeutral: triggers.onGitHubWorkflowJobNeutral, onWorkflowJobQueued: triggers.onGitHubWorkflowJobQueued, onWorkflowJobSkipped: triggers.onGitHubWorkflowJobSkipped, onWorkflowJobStarted: triggers.onGitHubWorkflowJobStarted, onWorkflowJobSucceeded: triggers.onGitHubWorkflowJobSucceeded, onWorkflowJobTimedOut: triggers.onGitHubWorkflowJobTimedOut, onWorkflowJobWaiting: triggers.onGitHubWorkflowJobWaiting, onWorkflowRunActionRequired: triggers.onGitHubWorkflowRunActionRequired, onWorkflowRunCancelled: triggers.onGitHubWorkflowRunCancelled, onWorkflowRunCompleted: triggers.onGitHubWorkflowRunCompleted, onWorkflowRunEvent: triggers.onGitHubWorkflowRunEvent, onWorkflowRunFailed: triggers.onGitHubWorkflowRunFailed, onWorkflowRunNeutral: triggers.onGitHubWorkflowRunNeutral, onWorkflowRunRequested: triggers.onGitHubWorkflowRunRequested, onWorkflowRunSkipped: triggers.onGitHubWorkflowRunSkipped, onWorkflowRunStale: triggers.onGitHubWorkflowRunStale, onWorkflowRunStarted: triggers.onGitHubWorkflowRunStarted, onWorkflowRunStartupFailed: triggers.onGitHubWorkflowRunStartupFailed, onWorkflowRunSucceeded: triggers.onGitHubWorkflowRunSucceeded, onWorkflowRunTimedOut: triggers.onGitHubWorkflowRunTimedOut, } /** The combined GitHub action and trigger surface. */ type GitHubCallables = typeof githubActions & typeof githubTriggers /** GitHub callables. */ export const github: GitHubCallables = { ...githubActions, ...githubTriggers, } export * from "./actions" export * from "./triggers" export { getGitHubApi } from "./lib/api" export * from "@automate.ax/integration-contracts/github" export { GITHUB_ACTIONS_READ_SCOPE, GITHUB_ACTIONS_WRITE_SCOPE, GITHUB_COMMIT_STATUSES_READ_SCOPE, GITHUB_COMMIT_STATUSES_WRITE_SCOPE, GITHUB_CHECKS_READ_SCOPE, GITHUB_CHECKS_WRITE_SCOPE, GITHUB_CONTENTS_READ_SCOPE, GITHUB_CONTENTS_WRITE_SCOPE, GITHUB_DEPLOYMENTS_READ_SCOPE, GITHUB_DEPLOYMENTS_WRITE_SCOPE, GITHUB_ISSUES_READ_SCOPE, GITHUB_ISSUES_WRITE_SCOPE, GITHUB_METADATA_READ_SCOPE, GITHUB_PULL_REQUESTS_READ_SCOPE, GITHUB_PULL_REQUESTS_WRITE_SCOPE, GITHUB_WORKFLOWS_WRITE_SCOPE, } from "./lib/scopes"