diff --git a/action.yml b/action.yml index 67bc773..18dff49 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,8 @@ outputs: value: ${{ steps.action.outputs.workflow-run-id }} interaction-comment: value: ${{ steps.action.outputs.interaction-comment }} + version: + value: ${{ steps.action.outputs.version }} runs: using: "composite" steps: diff --git a/src/main/java/io/quarkus/bot/release/ReleaseAction.java b/src/main/java/io/quarkus/bot/release/ReleaseAction.java index e9a3cef..37c88cf 100644 --- a/src/main/java/io/quarkus/bot/release/ReleaseAction.java +++ b/src/main/java/io/quarkus/bot/release/ReleaseAction.java @@ -75,8 +75,14 @@ void startRelease(Context context, Commands commands, @Issue.Opened GHEventPaylo react(commands, issue, ReactionContent.PLUS_ONE); - handleSteps(context, commands, issuePayload.getIssue(), updatedIssueBody, null, releaseInformation, - new ReleaseStatus(Status.STARTED, Step.PREREQUISITES, StepStatus.STARTED, context.getGitHubRunId())); + try { + handleSteps(context, commands, issuePayload.getIssue(), updatedIssueBody, null, releaseInformation, + new ReleaseStatus(Status.STARTED, Step.PREREQUISITES, StepStatus.STARTED, context.getGitHubRunId())); + } finally { + if (releaseInformation.getVersion() != null) { + commands.setOutput(Outputs.VERSION, releaseInformation.getVersion()); + } + } } @Action @@ -107,7 +113,13 @@ void onComment(Context context, Commands commands, @IssueComment.Created GHEvent throw e; } - handleSteps(context, commands, issue, updatedIssueBody, issueComment, releaseInformation, releaseStatus); + try { + handleSteps(context, commands, issue, updatedIssueBody, issueComment, releaseInformation, releaseStatus); + } finally { + if (releaseInformation.getVersion() != null) { + commands.setOutput(Outputs.VERSION, releaseInformation.getVersion()); + } + } } private void handleSteps(Context context, Commands commands, GHIssue issue, UpdatedIssueBody updatedIssueBody, diff --git a/src/main/java/io/quarkus/bot/release/step/Prerequisites.java b/src/main/java/io/quarkus/bot/release/step/Prerequisites.java index ac168ec..5ad3d30 100644 --- a/src/main/java/io/quarkus/bot/release/step/Prerequisites.java +++ b/src/main/java/io/quarkus/bot/release/step/Prerequisites.java @@ -62,7 +62,7 @@ public int run(Context context, Commands commands, ReleaseInformation releaseInf comment.append("- This is a preview release (e.g. `Alpha`, `Beta`, `CR`).\n"); } comment.append( - "\nPlease add a `" + Command.YES.getFullCommand() + "` comment if you want to pursue with the release.\n"); + "\nPlease approve with a `" + Command.YES.getFullCommand() + "` comment if you want to pursue with the release.\n"); comment.append("\nIf not, simply close this issue."); commands.setOutput(Outputs.INTERACTION_COMMENT, comment.toString()); diff --git a/src/main/java/io/quarkus/bot/release/util/Outputs.java b/src/main/java/io/quarkus/bot/release/util/Outputs.java index 864dc91..81690c6 100644 --- a/src/main/java/io/quarkus/bot/release/util/Outputs.java +++ b/src/main/java/io/quarkus/bot/release/util/Outputs.java @@ -4,6 +4,7 @@ public final class Outputs { public static final String WORKFLOW_RUN_ID = "workflow-run-id"; public static final String INTERACTION_COMMENT = "interaction-comment"; + public static final String VERSION = "version"; private Outputs() { }