Class ManageLabelGitHubAction
java.lang.Object
me.julb.applications.github.actions.ManageLabelGitHubAction
- All Implemented Interfaces:
me.julb.sdk.github.actions.spi.GitHubActionProvider
public class ManageLabelGitHubAction
extends Object
implements me.julb.sdk.github.actions.spi.GitHubActionProvider
The action to manage labels.
- Author:
- Julb.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Connects to GitHub API.(package private) void
createLabels
(@NonNull Collection<LabelDTO> labelsToCreate) Create the given labels in the repository.(package private) void
deleteLabels
(@NonNull Collection<org.kohsuke.github.GHLabel> labelsToDelete) Deletes the given labels from the repository.void
execute()
Gets allGHLabel
present in the repository.(package private) String[]
Gets the "from" input.getInputLabels
(@NonNull String[] labelSources) Gets allGHLabel
present in the repository.(package private) boolean
Gets the "skip_delete" input.(package private) InputStream
getInputStream
(@NonNull String labelSource) Gets the input stream according to the given source.(package private) void
updateLabels
(@NonNull Map<LabelDTO, org.kohsuke.github.GHLabel> labelsToUpdate) Updates the given labels in the repository.
-
Constructor Details
-
ManageLabelGitHubAction
public ManageLabelGitHubAction()
-
-
Method Details
-
execute
public void execute()- Specified by:
execute
in interfaceme.julb.sdk.github.actions.spi.GitHubActionProvider
-
getInputFrom
String[] getInputFrom()Gets the "from" input.- Returns:
- the "from" input.
-
getInputSkipDelete
boolean getInputSkipDelete()Gets the "skip_delete" input.- Returns:
- the "skip_delete" input.
-
connectApi
Connects to GitHub API.- Throws:
IOException
- if an error occurs.
-
getInputLabels
Gets allGHLabel
present in the repository.- Returns:
- all
GHLabel
present in the repository. - Throws:
IOException
- if an error occurs.
-
getInputStream
Gets the input stream according to the given source.- Parameters:
labelSource
- the label source.- Returns:
- the stream to consume that source.
- Throws:
IOException
- if an error occurs.
-
getGHLabels
Gets allGHLabel
present in the repository.- Returns:
- all
GHLabel
present in the repository. - Throws:
IOException
- if an error occurs.
-
createLabels
Create the given labels in the repository.- Parameters:
labelsToCreate
- the labels to create.- Throws:
IOException
- if an error occurs.
-
updateLabels
void updateLabels(@NonNull @NonNull Map<LabelDTO, org.kohsuke.github.GHLabel> labelsToUpdate) throws IOExceptionUpdates the given labels in the repository.- Parameters:
labelsToUpdate
- the labels to update.- Throws:
IOException
- if an error occurs.
-
deleteLabels
void deleteLabels(@NonNull @NonNull Collection<org.kohsuke.github.GHLabel> labelsToDelete) throws IOException Deletes the given labels from the repository.- Parameters:
labelsToDelete
- the labels to create.- Throws:
IOException
- if an error occurs.
-