Repository navigation
docker-smoke: add smoke-command and fail-on-log-pattern, dump logs on any failure - #34
Merged
Merged
Conversation
… any failure smoke-command runs after the Host-header probe with SMOKE_BASE_URL set; a non-zero exit fails the action. It is passed through env and run by an inner bash, not interpolated into the script. fail-on-log-pattern fails the action when the container log matches an extended regex. The last 200 lines of the container log are printed when any step fails, replacing the full dump the probe printed on its own failure. Both inputs default to empty, so existing callers are unaffected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…no match Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Adds two optional inputs to the
docker-smokeaction, for the Strapi sites' frontend gate (same change wemove.eu made inline in WeMoveEU/wemove.eu#109):smoke-command: shell command run after the Host-header probe succeeds, from the workspace root, withSMOKE_BASE_URL=http://localhost:<port>set. A non-zero exit fails the action. It goes throughenvand runs under an innerbash -eo pipefail -c, so the caller's text is never spliced into the script body.fail-on-log-pattern: extended regex. After the probe and smoke-command, the action fails ifdocker logs ci-smokematches it. A grep error (bad regex) also fails, rather than passing silently.The last 200 lines of the container log are now printed whenever any step fails. That replaces the full
docker logsthe probe printed on its own failure.Both inputs default to empty and their steps are skipped, so current callers (toolbox etc.) run the same steps as before.
Release after merge:
v14.8.0, withv14moved to it. README has the inputs, a sample, and the v14.8 entry.Tested on this PR with a throwaway workflow (added in one commit, removed in the last; run 36155902199), five cases against a
python:3-alpinehttp.server image:SMOKE_BASE_URL=http://localhost:8080(unclosed: the action fails withgrep failed on fail-on-log-pattern🤖 Generated with Claude Code