Class Triggers.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<Triggers>
    Enclosing interface:
    Triggers

    @Stability(Experimental)
    public static final class Triggers.Builder
    extends Object
    implements software.amazon.jsii.Builder<Triggers>
    A builder for Triggers
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • create

        @Stability(Experimental)
        public Triggers.Builder create​(CreateOptions create)
        Sets the value of Triggers.getCreate()
        Parameters:
        create - Runs your workflow anytime someone creates a branch or tag, which triggers the create event.
        Returns:
        this
      • delete

        @Stability(Experimental)
        public Triggers.Builder delete​(DeleteOptions delete)
        Sets the value of Triggers.getDelete()
        Parameters:
        delete - Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event.
        Returns:
        this
      • deployment

        @Stability(Experimental)
        public Triggers.Builder deployment​(DeploymentOptions deployment)
        Sets the value of Triggers.getDeployment()
        Parameters:
        deployment - 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.
        Returns:
        this
      • deploymentStatus

        @Stability(Experimental)
        public Triggers.Builder deploymentStatus​(DeploymentStatusOptions deploymentStatus)
        Parameters:
        deploymentStatus - 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.
        Returns:
        this
      • discussion

        @Stability(Experimental)
        public Triggers.Builder discussion​(DiscussionOptions discussion)
        Sets the value of Triggers.getDiscussion()
        Parameters:
        discussion - Runs your workflow anytime the discussion event occurs. More than one activity type triggers this event.
        Returns:
        this
      • fork

        @Stability(Experimental)
        public Triggers.Builder fork​(ForkOptions fork)
        Sets the value of Triggers.getFork()
        Parameters:
        fork - Runs your workflow anytime when someone forks a repository, which triggers the fork event.
        Returns:
        this
      • gollum

        @Stability(Experimental)
        public Triggers.Builder gollum​(GollumOptions gollum)
        Sets the value of Triggers.getGollum()
        Parameters:
        gollum - Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event.
        Returns:
        this
      • mergeGroup

        @Stability(Experimental)
        public Triggers.Builder mergeGroup​(MergeGroupOptions mergeGroup)
        Sets the value of Triggers.getMergeGroup()
        Parameters:
        mergeGroup - Runs your workflow when a pull request is added to a merge queue, which adds the pull request to a merge group.
        Returns:
        this
      • pageBuild

        @Stability(Experimental)
        public Triggers.Builder pageBuild​(PageBuildOptions pageBuild)
        Sets the value of Triggers.getPageBuild()
        Parameters:
        pageBuild - Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event.
        Returns:
        this
      • publicValue

        @Stability(Experimental)
        public Triggers.Builder publicValue​(PublicOptions publicValue)
        Sets the value of Triggers.getPublicValue()
        Parameters:
        publicValue - Runs your workflow anytime someone makes a private repository public, which triggers the public event.
        Returns:
        this
      • pullRequestTarget

        @Stability(Experimental)
        public Triggers.Builder pullRequestTarget​(PullRequestTargetOptions pullRequestTarget)
        Parameters:
        pullRequestTarget - This event runs in the context of the base of the pull request, rather than in the merge commit as the pull_request event does. This prevents executing unsafe workflow code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow. This event allows you to do things like create workflows that label and comment on pull requests based on the contents of the event payload.

        WARNING: The pull_request_target event is granted read/write repository token and can access secrets, even when it is triggered from a fork. Although the workflow runs in the context of the base of the pull request, you should make sure that you do not check out, build, or run untrusted code from the pull request with this event. Additionally, any caches share the same scope as the base branch, and to help prevent cache poisoning, you should not save the cache if there is a possibility that the cache contents were altered.

        Returns:
        this
      • push

        @Stability(Experimental)
        public Triggers.Builder push​(PushOptions push)
        Sets the value of Triggers.getPush()
        Parameters:
        push - Runs your workflow when someone pushes to a repository branch, which triggers the push event.
        Returns:
        this
      • repositoryDispatch

        @Stability(Experimental)
        public Triggers.Builder repositoryDispatch​(RepositoryDispatchOptions repositoryDispatch)
        Parameters:
        repositoryDispatch - 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.
        Returns:
        this
      • schedule

        @Stability(Experimental)
        public Triggers.Builder schedule​(List<? extends CronScheduleOptions> schedule)
        Sets the value of Triggers.getSchedule()
        Parameters:
        schedule - You can schedule a workflow to run at specific UTC times using POSIX cron syntax. 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.
        Returns:
        this
      • status

        @Stability(Experimental)
        public Triggers.Builder status​(StatusOptions status)
        Sets the value of Triggers.getStatus()
        Parameters:
        status - Runs your workflow anytime the status of a Git commit changes, which triggers the status event.
        Returns:
        this
      • workflowDispatch

        @Stability(Experimental)
        public Triggers.Builder workflowDispatch​(WorkflowDispatchOptions workflowDispatch)
        Parameters:
        workflowDispatch - You can configure custom-defined input properties, default input values, and required inputs for the event directly in your workflow. When the workflow runs, you can access the input values in the github.event.inputs context.
        Returns:
        this
      • workflowRun

        @Stability(Experimental)
        public Triggers.Builder workflowRun​(WorkflowRunOptions workflowRun)
        Sets the value of Triggers.getWorkflowRun()
        Parameters:
        workflowRun - 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. A workflow run is triggered regardless of the result of the previous workflow.
        Returns:
        this
      • build

        @Stability(Experimental)
        public Triggers build()
        Builds the configured instance.
        Specified by:
        build in interface software.amazon.jsii.Builder<Triggers>
        Returns:
        a new instance of Triggers
        Throws:
        NullPointerException - if any required attribute was not provided