Skip to content

docs, refactor: modernize action — composite runner, stdlib config, full README - #4

Merged
KyleJamesWalker merged 10 commits into
mainfrom
update-docs-and-examples
May 21, 2026
Merged

docs, refactor: modernize action — composite runner, stdlib config, full README#4
KyleJamesWalker merged 10 commits into
mainfrom
update-docs-and-examples

Conversation

@KyleJamesWalker

Copy link
Copy Markdown
Owner

Closes #2

Summary

  • Rewrote README with full inputs/outputs reference and 6 annotated usage examples covering the most common patterns (monorepo matrix, subdirectory scoping, per-component injection, release guards, serialized jobs, matrix enrichment)
  • Composite action replaces the Docker container action — no Docker build step, runs directly via actions/setup-python + pip install
  • stdlib dataclass config replaces yamlsettings dependency — zero runtime dependencies
  • GITHUB_OUTPUT replaces deprecated ::set-output workflow command
  • Floating tag workflow (update-floating-tags.yaml) — publishes a v<major> tag on every semver release so callers can pin to @v0
  • Bug fixes: inject_primary_key=None crash, empty string in changes list, bare open() without context manager

What callers need to change

Nothing beyond updating the tag. All inputs and outputs are backward compatible.

Test plan

  • All 8 unit tests pass (pytest)
  • pre-commit clean
  • README examples are syntactically valid GitHub Actions YAML (all jobs have runs-on)
  • Verify update-floating-tags.yaml creates a v0 tag after merging and publishing a release

(\__/)
(+'.'+)
(")_(")

Bunny helped with this PR and is one step closer to world domination...

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
@KyleJamesWalker
KyleJamesWalker merged commit 30c09ca into main May 21, 2026
8 checks passed
@KyleJamesWalker
KyleJamesWalker deleted the update-docs-and-examples branch May 21, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the Docs

1 participant