Skip to content

Run Octopus Deploy Runbook: warn when the child runbook warns - #1708

Open
JeremyCamplin wants to merge 1 commit into
OctopusDeploy:masterfrom
JeremyCamplin:run-runbook-warning-on-child-warnings
Open

JeremyCamplin wants to merge 1 commit into
OctopusDeploy:masterfrom
JeremyCamplin:run-runbook-warning-on-child-warnings

Conversation

@JeremyCamplin

@JeremyCamplin JeremyCamplin commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Background

When using the Run Octopus Deploy Runbook step template and "Wait for finish" is enabled then the step treated State == Success as a clean pass, so a child runbook run that logged warnings showed the parent step as plain Success.
Updated the code to check the task's HasWarningsOrErrors flag and log a warning with a link to the child task so the step shows "Success with warning". Exit code and all other branches are unchanged.

Before

if ($taskStatusResponseState -eq "Success")
{
    Write-OctopusSuccess "The task has finished with a status of Success"
    exit 0
}

After

if ($taskStatusResponseState -eq "Success")
{
    if ($taskStatusResponse.HasWarningsOrErrors -eq $true)
    {
        Write-OctopusWarning "The task finished with a status of Success but logged warnings, see $runbookBaseUrl/app#/$spaceId/tasks/$runbookServerTaskId"
    }
    else
    {
        Write-OctopusSuccess "The task has finished with a status of Success"
    }
    exit 0
}

Side by side comparison of version 20 v version 21
Screenshot 2026-10-13 160657

Pre-requisites

  • Id should be a GUID that is not 00000000-0000-0000-0000-000000000000
    • NOTE If you are modifying an existing step template, please make sure that you do not modify the Id property (updating the Id will break the Library sync functionality in Octopus).
  • Version should be incremented, otherwise the integration with Octopus won't update the step template correctly
  • $Meta must have ExportedAt and OctopusVersion updated
  • Parameter names should not start with $
  • Step template parameter names (the ones declared in the JSON, not the script body) should be prefixed with a namespace so that they are less likely to clash with other user-defined variables in Octopus (see this issue). For example, use an abbreviated name of the step template or the category of the step template).
  • LastModifiedBy field must be present, and (optionally) updated with the correct author
  • The best practices documented here have been applied
  • If a new Category has been created:
    • An image with the name {categoryname}.png must be present under the step-templates/logos folder
    • The switch in the humanize function in gulpfile.babel.js must have a case statement corresponding to it

…with warnings

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Review this PR in Hyponome for a side-by-side diff of the step-template JSON and any embedded scripts.

@CLAassistant

CLAassistant commented Oct 13, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants