Class ManageMilestoneGitHubAction

java.lang.Object
me.julb.applications.github.actions.ManageMilestoneGitHubAction
All Implemented Interfaces:
me.julb.sdk.github.actions.spi.GitHubActionProvider

public class ManageMilestoneGitHubAction extends Object implements me.julb.sdk.github.actions.spi.GitHubActionProvider
The action to manage milestones.
Author:
Julb.
  • Constructor Details

    • ManageMilestoneGitHubAction

      public ManageMilestoneGitHubAction()
  • Method Details

    • execute

      public void execute()
      Specified by:
      execute in interface me.julb.sdk.github.actions.spi.GitHubActionProvider
    • getInputTitle

      String getInputTitle()
      Gets the "title" input.
      Returns:
      the "title" input.
    • getInputState

      InputMilestoneState getInputState()
      Gets the "state" input.
      Returns:
      the "state" input.
    • getInputDescription

      Optional<String> getInputDescription()
      Gets the "description" input.
      Returns:
      the "description" input.
    • getInputDueOn

      Optional<Date> getInputDueOn()
      Gets the "due_on" input.
      Returns:
      the "due_on" input.
    • connectApi

      void connectApi() throws IOException
      Connects to GitHub API.
      Throws:
      IOException - if an error occurs.
    • getGHMilestone

      Optional<org.kohsuke.github.GHMilestone> getGHMilestone(@NonNull @NonNull String title) throws IOException
      Gets the GHMilestone milestone matching the given title.
      Parameters:
      title - the milestone title to look for.
      Returns:
      the GHMilestone for the given title if exists, false otherwise.
      Throws:
      IOException - if an error occurs.
    • createGHMilestone

      org.kohsuke.github.GHMilestone createGHMilestone(@NonNull @NonNull String title, @NonNull @NonNull org.kohsuke.github.GHMilestoneState state, @NonNull @NonNull Optional<String> description, @NonNull @NonNull Optional<Date> dueOn, @NonNull @NonNull Optional<org.kohsuke.github.GHMilestone> existingMilestone) throws IOException
      Creates or updates the GHMilestone if any.
      Parameters:
      title - the milestone title.
      state - the milestone state.
      description - the milestone description, or Optional.empty() if the description is empty.
      dueOn - the milestone due on date, or Optional.empty() if there is no due date.
      existingMilestone - the existing milestone, or Optional.empty() if there is no existing milestone.
      Returns:
      the GHMilestone created or updated.
      Throws:
      IOException - if an error occurs.
    • deleteGHMilestone

      void deleteGHMilestone(@NonNull @NonNull Optional<org.kohsuke.github.GHMilestone> milestoneToDelete) throws IOException
      Deletes the GHMilestone if any.
      Parameters:
      milestoneToDelete - the GHMilestone to delete, or Optional.empty().
      Throws:
      IOException - if an error occurs.