docs, refactor: modernize action — composite runner, stdlib config, full README - #4
Merged
Merged
Conversation
Replaces the minimal README with a complete inputs/outputs reference table, an explanation of the three-layer parameter merge, and six annotated usage examples covering common patterns: minimal setup, subdirectory scoping, per-component inject_params, release workflow guards, serialized matrix jobs, and two-stage matrix enrichment. Example workflows are also updated: actions/checkout bumped to v4, inline comments added, inject_params boolean fixed (True → true), and fail-fast: false added to matrix strategy blocks.
When a release is published with a vX.Y.Z tag, force-updates the corresponding vX floating tag to point to the same commit. This lets consumers pin to a major version (e.g. @v0) and automatically receive non-breaking updates without changing their workflow files. Tags that don't match vX.Y.Z are skipped gracefully (exit 0) so pre-release or non-semver tags don't cause failures.
Rewrites config.py to read INPUT_* env vars directly using os.environ and json.loads, eliminating the yamlsettings dependency entirely. Config is now a plain dataclass with flat attributes instead of a nested YAMLDict accessed via cfg.input.inject.primary_key-style paths. Also fixes several bugs discovered during the review: - gh.py: empty string after .strip().split() was poisoning the changes list when a PR had no files; filter with 'if c' - gh.py: stderr was not captured, hiding error messages on failure - gh.py: return type annotation was None instead of List[str] - action.py: inject_primary_key=None caused cur[None] KeyError; guard with explicit lookup_key fallback - action.py: set_output used bare open() risking file handle leak on exception; replaced with 'with' block - action.py: include_file used result |= True pattern; replaced with early return and any() - __main__.py: 'True if matrix else False' simplified to bool(matrix) Made-with: Bunny
Adds [build-system], [project], [project.scripts], and [tool.setuptools.packages.find] tables to pyproject.toml, making setup.py redundant. Removes the yamlsettings<3 runtime dependency (no longer used after the config rewrite). Bumps test dependencies to current versions: pytest>=8.0, pytest-cov>=6.0, pytest-xdist>=3.0, and removes pook which was listed but never used in tests. Made-with: Bunny
Replaces the Docker container action (254MB image pull per run) with a composite action that installs Python 3.11 via actions/setup-python@v5 and runs the package directly. Composite actions work on all runner types, start in seconds instead of minutes, and require no image builds or Docker Hub account. action.yml: input/output descriptions improved; outputs now declare 'value:' references required by composite actions; paths_include and paths_ignore get explicit 'null' defaults so the JSON parser always has a valid value. pr-test.yaml: checkout@v4, setup-python@v5, pip cache enabled, install command updated to '.[test]' extra. Removes Dockerfile, Dockerfile.test, and docker-compose.yaml. Made-with: Bunny
Three example jobs (build, tag-create, version-bump) were missing the required runs-on field, which would cause workflows copied verbatim to fail validation. Also adds fail-fast: false to the tag-create example for consistency with the other matrix jobs. Made-with: Bunny
Add missing docstrings flagged by ruff (D101/D103) and apply isort/black formatting fixes to action.py, config.py, gh.py, and test_action.py. Made-with: Bunny
When the action is used locally via uses: ./, github.action_path resolves to a path ending in /., which actions/setup-python@v5 rejects with Relative pathing . and .. is not allowed. Removing cache-dependency-path is safe — the action has no runtime dependencies, so there is no lockfile to pin the cache key to. Made-with: Bunny
Shell best practice: quote expressions used as git arguments. Made-with: Bunny
Major version bump reflecting composite action rewrite, stdlib config, full README, and bug fixes introduced in this branch. Made-with: Bunny
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.
Closes #2
Summary
actions/setup-python+pip installyamlsettingsdependency — zero runtime dependencies::set-outputworkflow commandupdate-floating-tags.yaml) — publishes av<major>tag on every semver release so callers can pin to@v0inject_primary_key=Nonecrash, empty string in changes list, bareopen()without context managerWhat callers need to change
Nothing beyond updating the tag. All inputs and outputs are backward compatible.
Test plan
pytest)pre-commitcleanruns-on)update-floating-tags.yamlcreates av0tag after merging and publishing a releaseBunny helped with this PR and is one step closer to world domination...