Fix issue with regex check + missing outputs in v2.6.0 #40
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.
In v2.6.0, the regex check was added for
delete_preview_after
, which would populate theEXPIRATION_HOURS
variable with the expiration hours value.However, this regex check did not take into account commented out lines in a Docker Compose file, which meant that not only would this work incorrectly when ran, but if there were multiple commented out entries with a matching line/value, it would return every commented out result, such as the following:
The example above would cause the workflow to fail with the following:
This proposed regex change will still return all results, however since it now also ignores commented out lines, this shouldn't matter and should purely be user error, in case the user is defining the same values two (or more) times per compose file.
UPDATE
I additionally noticed that PR #35 seems to have broken more than it has fixed, and I'm not quite sure what the idea was with replacing the already working logic with environment variables.
The PR mentioned above removed the deprecated
set-output
method of defining outputs, however it never implemented the new way of creating outputs, which means that the reusable workflow no longer exports any of the outputs.I made an additional commit that fixes this, but I would advise rewriting/refactoring the entire workflow file, as the order of the jobs/steps, as well as the now even more unnecessarily complex dependency, variable and output logic, are all making it that much harder to find issues in and to improve in the future.
NOTE: In addition to fixing this, I also added
expiration
andexpiration_interval
to the actual action's outputs, however I'm not sure if these are currently being exported by the action itself. So just FYI.EDIT: Also added
expiration_timestamp
in UNIX timestamp format, as this is the most versatile and useful option when integrating with other services and workflows.