Skip to content

Commit

Permalink
Support setting initial delay and post delay to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Feb 8, 2024
1 parent 9e8a797 commit fb8528d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ It is developed in Quarkus using the [Quarkus GitHub Action](https://github.com/
| `group-id` | Group id of the artifact |
| `artifact-id` | Artifact id of the artifact |
| `version` | Version of the artifact |
| `initial-delay` | Initial delay in minutes before testing for the first time |
| `initial-delay` | Initial delay in minutes before testing for the first time (use 0 to disable) |
| `poll-delay` | Poll delay in minutes |
| `poll-iterations` | Number of polling iterations |
| `post-delay` | Delay in minutes to wait after this particular artifact is published |
| `post-delay` | Delay in minutes to wait after this particular artifact is published (use 0 to disable) |
| `issue-number` (optional) | Issue number to post to |
| `message-if-published` (optional) | Message to post if artifact is published |
| `message-if-not-published` (optional) | Message to post if artifact is not published |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ void monitor(Context context, Commands commands, Inputs inputs, GitHub gitHub) {

commands.notice("Monitoring publication for artifact " + gav.toCoordinates());

wait(commands, inputs.getRequiredInt(InputKeys.INITIAL_DELAY));
int initialDelay = inputs.getRequiredInt(InputKeys.INITIAL_DELAY);
if (initialDelay > 0) {
wait(commands, initialDelay);
}

if (isGAVPublished(gav)) {
handlePublished(context, commands, inputs, gitHub, gav);
Expand All @@ -54,7 +57,10 @@ private void handlePublished(Context context, Commands commands, Inputs inputs,
+ inputs.getRequiredInt(InputKeys.POST_DELAY) + " mn to give some time to the other artifacts");

commands.setOutput(OutputKeys.PUBLISHED, "true");
wait(commands, inputs.getRequiredInt(InputKeys.POST_DELAY));
int postDelay = inputs.getRequiredInt(InputKeys.POST_DELAY);
if (postDelay > 0) {
wait(commands, postDelay);
}
postMessage(context, commands, gitHub, inputs, true);
}

Expand Down

0 comments on commit fb8528d

Please sign in to comment.