diff --git a/packages/lib/src/types/githubActionsWorkflow.ts b/packages/lib/src/types/githubActionsWorkflow.ts index 0c0be77..a2e72a3 100755 --- a/packages/lib/src/types/githubActionsWorkflow.ts +++ b/packages/lib/src/types/githubActionsWorkflow.ts @@ -42,160 +42,14 @@ export type Event = | 'workflow_dispatch' | 'workflow_run' | 'repository_dispatch' -/** - * Runs your workflow anytime the branch_protection_rule event occurs. More than one activity type triggers this event. - */ -export type BranchProtectionRuleEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the check_run event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/runs. - */ -export type CheckRunEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the check_suite event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/suites/. - */ -export type CheckSuiteEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime someone creates a branch or tag, which triggers the create event. For information about the REST API, see https://developer.github.com/v3/git/refs/#create-a-reference. - */ -export type CreateEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event. For information about the REST API, see https://developer.github.com/v3/git/refs/#delete-a-reference. - */ -export type DeleteEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime someone creates a deployment, which triggers the deployment event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/. - */ -export type DeploymentEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime a third party provides a deployment status, which triggers the deployment_status event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/#create-a-deployment-status. - */ -export type DeploymentStatusEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the discussion event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions - */ -export type DiscussionEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the discussion_comment event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions - */ -export type DiscussionCommentEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime when someone forks a repository, which triggers the fork event. For information about the REST API, see https://developer.github.com/v3/repos/forks/#create-a-fork. - */ -export type ForkEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event. - */ -export type GollumEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the issue_comment event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/comments/. - */ -export type IssueCommentEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the issues event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues. - */ -export type IssuesEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the label event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/labels/. - */ -export type LabelEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow when a pull request is added to a merge queue, which adds the pull request to a merge group. For information about the merge queue, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request-with-a-merge-queue . - */ -export type MergeGroupEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the milestone event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/milestones/. - */ -export type MilestoneEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event. For information about the REST API, see https://developer.github.com/v3/repos/pages/. - */ -export type PageBuildEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the project event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/. - */ -export type ProjectEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the project_card event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/cards. - */ -export type ProjectCardEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the project_column event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/columns. - */ -export type ProjectColumnEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime someone makes a private repository public, which triggers the public event. For information about the REST API, see https://developer.github.com/v3/repos/#edit. - */ -export type PublicEvent = { +export type EventObject = { [k: string]: unknown } | null /** * Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. * You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. */ -export type PullRequestEventTypes = ([unknown, ...unknown[]] | string) & - ( - | 'assigned' - | 'unassigned' - | 'labeled' - | 'unlabeled' - | 'opened' - | 'edited' - | 'closed' - | 'reopened' - | 'synchronize' - | 'converted_to_draft' - | 'ready_for_review' - | 'locked' - | 'unlocked' - | 'milestoned' - | 'demilestoned' - | 'review_requested' - | 'review_request_removed' - | 'auto_merge_enabled' - | 'auto_merge_disabled' - | 'enqueued' - | 'dequeued' - )[] +export type Types = [unknown, ...unknown[]] | string /** * When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref. * The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet. @@ -218,74 +72,6 @@ export type Branch = [string, ...string[]] * */ export type Path = [string, ...string[]] -/** - * Runs your workflow anytime the pull_request_review event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/reviews. - * Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. - * When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. - * Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. - * The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. - */ -export type PullRequestReviewEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/comments. - * Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. - * When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. - * Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. - * The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. - */ -export type PullRequestReviewCommentEvent = { - [k: string]: unknown -} | null -/** - * Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary. - * You can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events. - */ -export type PullRequestTargetEventTypes = ([unknown, ...unknown[]] | string) & - ( - | 'assigned' - | 'unassigned' - | 'labeled' - | 'unlabeled' - | 'opened' - | 'edited' - | 'closed' - | 'reopened' - | 'synchronize' - | 'converted_to_draft' - | 'ready_for_review' - | 'locked' - | 'unlocked' - | 'review_requested' - | 'review_request_removed' - | 'auto_merge_enabled' - | 'auto_merge_disabled' - )[] -/** - * Runs your workflow anytime a package is published or updated. For more information, see https://help.github.com/en/github/managing-packages-with-github-packages. - */ -export type RegistryPackageEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the release event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/releases/ in the GitHub Developer documentation. - */ -export type ReleaseEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the status of a Git commit changes, which triggers the status event. For information about the REST API, see https://developer.github.com/v3/repos/statuses/. - */ -export type StatusEvent = { - [k: string]: unknown -} | null -/** - * Runs your workflow anytime the watch event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/activity/starring/. - */ -export type WatchEvent = { - [k: string]: unknown -} | null /** * A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _. * @@ -323,19 +109,6 @@ export type WorkflowDispatchInput = { */ options?: [string, ...string[]] } -/** - * This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. For example, if your pull_request workflow generates build artifacts, you can create a new workflow that uses workflow_run to analyze the results and add a comment to the original pull request. - */ -export type WorkflowRunEvent = { - [k: string]: unknown -} | null -/** - * You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub. For more information, see https://developer.github.com/v3/repos/#create-a-repository-dispatch-event. - * To trigger the custom repository_dispatch webhook event, you must send a POST request to a GitHub API endpoint and provide an event_type name to describe the activity type. To trigger a workflow run, you must also configure your workflow to use the repository_dispatch event. - */ -export type RepositoryDispatchEvent = { - [k: string]: unknown -} | null export type StringContainingExpressionSyntax = string /** * You can override the default shell settings in the runner's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options. @@ -528,27 +301,90 @@ export interface Workflow { | Event | [Event, ...Event[]] | { - branch_protection_rule?: BranchProtectionRuleEvent - check_run?: CheckRunEvent - check_suite?: CheckSuiteEvent - create?: CreateEvent - delete?: DeleteEvent - deployment?: DeploymentEvent - deployment_status?: DeploymentStatusEvent - discussion?: DiscussionEvent - discussion_comment?: DiscussionCommentEvent - fork?: ForkEvent - gollum?: GollumEvent - issue_comment?: IssueCommentEvent - issues?: IssuesEvent - label?: LabelEvent - merge_group?: MergeGroupEvent - milestone?: MilestoneEvent - page_build?: PageBuildEvent - project?: ProjectEvent - project_card?: ProjectCardEvent - project_column?: ProjectColumnEvent - public?: PublicEvent + /** + * Runs your workflow anytime the branch_protection_rule event occurs. More than one activity type triggers this event. + */ + branch_protection_rule?: EventObject + /** + * Runs your workflow anytime the check_run event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/runs. + */ + check_run?: EventObject + /** + * Runs your workflow anytime the check_suite event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/suites/. + */ + check_suite?: EventObject + /** + * Runs your workflow anytime someone creates a branch or tag, which triggers the create event. For information about the REST API, see https://developer.github.com/v3/git/refs/#create-a-reference. + */ + create?: EventObject + /** + * Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event. For information about the REST API, see https://developer.github.com/v3/git/refs/#delete-a-reference. + */ + delete?: EventObject + /** + * Runs your workflow anytime someone creates a deployment, which triggers the deployment event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/. + */ + deployment?: EventObject + /** + * Runs your workflow anytime a third party provides a deployment status, which triggers the deployment_status event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/#create-a-deployment-status. + */ + deployment_status?: EventObject + /** + * Runs your workflow anytime the discussion event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions + */ + discussion?: EventObject + /** + * Runs your workflow anytime the discussion_comment event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions + */ + discussion_comment?: EventObject + /** + * Runs your workflow anytime when someone forks a repository, which triggers the fork event. For information about the REST API, see https://developer.github.com/v3/repos/forks/#create-a-fork. + */ + fork?: EventObject + /** + * Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event. + */ + gollum?: EventObject + /** + * Runs your workflow anytime the issue_comment event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/comments/. + */ + issue_comment?: EventObject + /** + * Runs your workflow anytime the issues event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues. + */ + issues?: EventObject + /** + * Runs your workflow anytime the label event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/labels/. + */ + label?: EventObject + /** + * Runs your workflow when a pull request is added to a merge queue, which adds the pull request to a merge group. For information about the merge queue, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request-with-a-merge-queue . + */ + merge_group?: EventObject + /** + * Runs your workflow anytime the milestone event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/milestones/. + */ + milestone?: EventObject + /** + * Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event. For information about the REST API, see https://developer.github.com/v3/repos/pages/. + */ + page_build?: EventObject + /** + * Runs your workflow anytime the project event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/. + */ + project?: EventObject + /** + * Runs your workflow anytime the project_card event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/cards. + */ + project_card?: EventObject + /** + * Runs your workflow anytime the project_column event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/columns. + */ + project_column?: EventObject + /** + * Runs your workflow anytime someone makes a private repository public, which triggers the public event. For information about the REST API, see https://developer.github.com/v3/repos/#edit. + */ + public?: EventObject /** * Runs your workflow anytime the pull_request event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls. * Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. @@ -559,7 +395,30 @@ export interface Workflow { pull_request?: | null | ({ - types?: PullRequestEventTypes + types?: Types & + ( + | 'assigned' + | 'unassigned' + | 'labeled' + | 'unlabeled' + | 'opened' + | 'edited' + | 'closed' + | 'reopened' + | 'synchronize' + | 'converted_to_draft' + | 'ready_for_review' + | 'locked' + | 'unlocked' + | 'milestoned' + | 'demilestoned' + | 'review_requested' + | 'review_request_removed' + | 'auto_merge_enabled' + | 'auto_merge_disabled' + | 'enqueued' + | 'dequeued' + )[] branches?: Branch 'branches-ignore'?: Branch tags?: Branch @@ -569,15 +428,48 @@ export interface Workflow { } & { [k: string]: unknown }) - pull_request_review?: PullRequestReviewEvent - pull_request_review_comment?: PullRequestReviewCommentEvent + /** + * Runs your workflow anytime the pull_request_review event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/reviews. + * Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. + * When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. + * Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. + * The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + */ + pull_request_review?: EventObject + /** + * Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/comments. + * Note: Workflows do not run on private base repositories when you open a pull request from a forked repository. + * When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository. + * Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository. + * The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions. + */ + pull_request_review_comment?: EventObject /** * This event is similar to pull_request, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload. */ pull_request_target?: | null | ({ - types?: PullRequestTargetEventTypes + types?: Types & + ( + | 'assigned' + | 'unassigned' + | 'labeled' + | 'unlabeled' + | 'opened' + | 'edited' + | 'closed' + | 'reopened' + | 'synchronize' + | 'converted_to_draft' + | 'ready_for_review' + | 'locked' + | 'unlocked' + | 'review_requested' + | 'review_request_removed' + | 'auto_merge_enabled' + | 'auto_merge_disabled' + )[] branches?: Branch 'branches-ignore'?: Branch tags?: Branch @@ -603,10 +495,22 @@ export interface Workflow { } & { [k: string]: unknown }) - registry_package?: RegistryPackageEvent - release?: ReleaseEvent - status?: StatusEvent - watch?: WatchEvent + /** + * Runs your workflow anytime a package is published or updated. For more information, see https://help.github.com/en/github/managing-packages-with-github-packages. + */ + registry_package?: EventObject + /** + * Runs your workflow anytime the release event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/releases/ in the GitHub Developer documentation. + */ + release?: EventObject + /** + * Runs your workflow anytime the status of a Git commit changes, which triggers the status event. For information about the REST API, see https://developer.github.com/v3/repos/statuses/. + */ + status?: EventObject + /** + * Runs your workflow anytime the watch event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/activity/starring/. + */ + watch?: EventObject /** * Allows workflows to be reused by other workflows. */ @@ -695,8 +599,15 @@ export interface Workflow { [k: string]: WorkflowDispatchInput } } - workflow_run?: WorkflowRunEvent - repository_dispatch?: RepositoryDispatchEvent + /** + * This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. For example, if your pull_request workflow generates build artifacts, you can create a new workflow that uses workflow_run to analyze the results and add a comment to the original pull request. + */ + workflow_run?: EventObject + /** + * You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub. For more information, see https://developer.github.com/v3/repos/#create-a-repository-dispatch-event. + * To trigger the custom repository_dispatch webhook event, you must send a POST request to a GitHub API endpoint and provide an event_type name to describe the activity type. To trigger a workflow run, you must also configure your workflow to use the repository_dispatch event. + */ + repository_dispatch?: EventObject /** * You can schedule a workflow to run at specific UTC times using POSIX cron syntax (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07). You can optionally specify a timezone using an IANA timezone string (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for timezone-aware scheduling. Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes. * Note: GitHub Actions does not support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly, and @reboot.