Fix for issue 2232: Many lines of "Could not find any stages to run" on run #2272
+7
β11
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.
Fixes #2232: Many lines of "Could not find any stages to run" on run
Fixes #1993: Unexpected failure due to warning "Could not find any stages to run"
Issues #2232 and #1993 were introduced with pull request #1970.
The Problem
#1970 prints a lot of messages even when there isnβt a problem, since the check is called twice for each workflow file in the workflows directory:
In addition, it prints an error message at the end of the run, even if the job was run successfully:
This also has the side effect of causing act to return an error code (1), even if the run was successful:
The Fix
This pull request fixes these issues by making the following changes:
root.go
This solves both problems mentioned above:
With this fix, the output is as follows. Note the error code returned in both cases:
Normal run, including return code of 0:
Failed run because no valid jobs were found, including return code of 1: