I have an email notification step that generates an email when a deployment is completed. The below HTML spits out too much info. It includes all the steps even if they are excluded. What is the best way to have this only provide the steps that were completed and does not include any steps that were excluded in the deployment? Thanks!
<h2>Deployment of #{Octopus.Project.Name} #{Octopus.Release.Number} to #{Octopus.Environment.Name}</h2>
<p><em>Initiated by #{unless Octopus.Deployment.CreatedBy.DisplayName}#{Octopus.Deployment.CreatedBy.Username}#{/unless} #{if Octopus.Deployment.CreatedBy.DisplayName}#{Octopus.Deployment.CreatedBy.DisplayName}#{/if} #{if Octopus.Deployment.CreatedBy.EmailAddress} (<a href="mailto:%20#{Octopus.Deployment.CreatedBy.EmailAddress}">#{Octopus.Deployment.CreatedBy.EmailAddress}</a>)#{/if} at #{Octopus.Deployment.Created}</em><br>
<h3>Deployment process</h3>
<p>The deployment included the following actions:</p>
<ul>
<li style="list-style: none">#{each action in Octopus.Action}</li>
<li><strong>#{action.Name}</strong> #{if action.Package.NuGetPackageId}— {action.Package.NuGetPackageId} <em>version #{action.Package.NuGetPackageVersion}#{/if}</em></li>
<li style="list-style: none">#{/each}</li>
</ul>
Thanks for reaching out, and for the great question. Thankfully, this is a relatively easy to do. You can operate on action.IsSkipped (Octopus.Action.IsSkipped is the boolean variable) here to only operate on steps that actively ran.