feat: Add --runbook-tag flag to run multiple runbooks by tag#576
Open
HuyPhanNguyen wants to merge 6 commits intomainfrom
Open
feat: Add --runbook-tag flag to run multiple runbooks by tag#576HuyPhanNguyen wants to merge 6 commits intomainfrom
HuyPhanNguyen wants to merge 6 commits intomainfrom
Conversation
Add --runbook-tag flag to 'runbook run' command to execute all runbooks matching specified tags
grace-rehn
approved these changes
Jan 22, 2026
Contributor
grace-rehn
left a comment
There was a problem hiding this comment.
Nice! LGTM, tested locally with db and git runbooks.
hnrkndrssn
reviewed
Jan 30, 2026
Contributor
hnrkndrssn
left a comment
There was a problem hiding this comment.
A few suggestions and a question around new code path vs existing.
| if f.IsPromptEnabled() && flags.RunbookName.Value == "" && len(flags.RunbookTags.Value) == 0 { | ||
| var runBySelection string | ||
| err = f.Ask(&survey.Select{ | ||
| Message: "How do you want to run runbooks?", |
Contributor
There was a problem hiding this comment.
Suggested change
| Message: "How do you want to run runbooks?", | |
| Message: "How do you want to select which runbook(s) to run?", |
| return nil, err | ||
| } | ||
|
|
||
| tagMap := make(map[string]bool) |
Contributor
There was a problem hiding this comment.
Why is it necessary to build this map first before populating the tag array? Wouldn't it be sufficient to build the string array directly here?
| return results | ||
| } | ||
|
|
||
| func runRunbooksByTag(cmd *cobra.Command, f factory.Factory, flags *RunFlags, octopus *octopusApiClient.Client, project *projects.Project, parsedVariables map[string]string, outputFormat string, isGit bool) error { |
Contributor
There was a problem hiding this comment.
This function doesn't follow the same path as when running a runbook by name. As a result it looks like we're missing a few optional values, most notably prompted variables.
This may cause issues for customers. Can we not implement the run by tags functionality into the existing workflow?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--runbook-tagflag to run all runbooks matching specified tags in a single command.Usage
octopus runbook run --project MyProject --runbook-tag "TagSet/Tag" --environment DevOutput
[sc-132551]