Skip to main content

Toolbox

This repository contains helper functions for:

  • Interacting with a run in prepare_assignment
    • Retrieving input
    • Setting output
  • Finding files based on globs
  • Creating zip files

Interacting with prepare_assignment

To help a prepare_assignment action interact with a run, a couple of helper functions are defined in core.py.

To retrieve input use the get_input function, this has the following parameters:

  • key: str: The key of the input to retrieve, this is the same as the key as defined in the action.yml
  • required: bool= False: if true and the key is not present it will raise an exception
  • trim_whitespace: bool: if true it will automatically trim whitespace from the retrieved value

To set output that can be used by other actions in the run, use the set_output function. This function has the following parameters:

  • name: str: the key that other actions can use to retrieve the value
  • value: Any: the value

Furthermore it defines helper methods for logging:

  • set_failed: log exception/message with level ERROR and exit the process
  • set_error: log exception/message with level ERROR
  • set_warning: log message with level WARNING
  • info: log message with level INFO
  • debug: log message with level DEBUG

Finding files

A common task for actions is to find files based on a glob. To make this repetitive task easier a helper function is defined in file.py. The function get_matching_files returns a list of paths (as strings) that match the files, given the parameters. The following parameters are available:

  • included: Union[str, List[str]]: Glob(s) that should be matched
  • excluded: Union[str, List[str], None]: Glob(s) that should be excluded from being matched. I.e. if a path matches the included glob, it should not be processed if it also matches the excluded glob. Default: None
  • relative_to: : Union[str, None]: Set relative path from where the globs should be matched. If None the current working directory is used. Default: None
  • allow_outside_working_dir: bool: Allow relative_to to be outside the current working directory. Allow the matched glob(s) to be outside the relative_to directory. Default: False
  • recursive: bool: If true the glob should recurse directories. Default: True

Creating zip files

To help with creating zip files the zip.py adds a helper method create_zip to easily create a simple zip archive. It takes the following parameters:

  • name: str: name of the archive
  • files: List[str]: paths to the files to include
  • output: Optional[str]: the output directory to write to (default to current working directory). Default: None

Releases

Releases are automated with semantic-release. Pull requests are squash merged, so the PR title becomes the commit on main and must follow Conventional Commits (checked on every PR):

PR title Release
fix: ... patch (1.2.3 → 1.2.4)
feat: ... minor (1.2.3 → 1.3.0)
feat!: ... or a BREAKING CHANGE: footer major (1.2.3 → 2.0.0)
docs:, chore:, ci:, build:, refactor:, test:, style:, perf: no release

On every merge to main the next version is determined, tagged (vX.Y.Z), a GitHub release is created and the package is published to PyPI. The version is set during the build and is not committed, so the version in pyproject.toml is not the released version.

Metadata

Release files for prepare-toolbox 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prepare-toolbox 0.4.4
File Size Uploaded Provenance Actions
prepare_toolbox-0.4.4.tar.gz 54.6 kB Without provenance Details for prepare_toolbox-0.4.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prepare-toolbox 0.4.4
File Interpreter ABI Platform Actions
prepare_toolbox-0.4.4-py3-none-any.whl Python 3 none any Details for prepare_toolbox-0.4.4-py3-none-any.whl

Total release size: 62.1 kB

Release files / prepare_toolbox-0.4.4.tar.gz

Download URL prepare_toolbox-0.4.4.tar.gz
Size 54.6 kB
Tags Source
SHA-256 checksum
How to use checksums
818d475fbc6ee6dce66c7aced9cb1eefda55fa62ef4f9da7008addacd1952b0d
BLAKE2b-256 checksum
How to use checksums
4d0ab4ebe800595df8b820723a4ae0d3ac5702810b6debfccf4530c0d2ddcbdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / prepare_toolbox-0.4.4-py3-none-any.whl

Download URL prepare_toolbox-0.4.4-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a22775878a040c9add82acb7c097f29a3a846c284c68b9ecd377d66774d7eb1
BLAKE2b-256 checksum
How to use checksums
ba0d99b8e13803cefece9fe5daf938151a1bb61e538f3a980ce5e22247b6fe89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for prepare-toolbox 0.4.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page