lfreleng-actions/Build Metadata Action

Universal action to capture, validate, and display comprehensive metadata for project builds across multiple languages and build systems

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jul 9, 2026
License
None

Pinned Snippet

workflow.ymlSHA-pinned
uses: lfreleng-actions/build-metadata-action@441d941775995fa0d562ee80b4cc6ed1230248ec # v0.6.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
path_prefixPath to the project root directoryno.
output_formatOutput format: summary, json, markdown, yamlnosummary
include_environmentCollect and include environment metadatanotrue
use_version_extractUse version-extract-action for version detection if availablenotrue
verboseEnable verbose logging outputnofalse
artifact_uploadUpload gathered metadata as workflow artifactsnotrue
artifact_name_prefixCustom prefix for artifact namesnobuild-metadata
artifact_formatsComma-separated list of formats to upload (json, yaml)nojson
validate_outputValidate JSON/YAML output before uploadingnotrue
strict_validationUse strict validation mode (round-trip testing)notrue
export_env_varsExport action outputs as variables for subsequent stepsnofalse
python_offline_modeWhen 'true', the Python extractor skips the live endoflife.date consultation and uses the action's static supported-version list (3.10 through 3.14 at the time of writing). Useful for hermetic builds or when the runner has no outbound network access. Default 'false' so the extractor benefits from live EOL data.nofalse
python_eol_timeoutendoflife.date HTTP timeout in seconds (online mode only)no5
python_eol_max_retriesendoflife.date HTTP retry budget (online mode only). Set to '0' to opt out of retries entirely (a single attempt with no retry on failure). Values are integers; negative values are treated as the documented default ('2').no2
namedescription
metadata_jsonComplete metadata as JSON string
metadata_yamlComplete metadata as YAML string
markdown_outputMarkdown formatted metadata
artifact_nameName of the uploaded artifact
artifact_pathPath to artifact directory
artifact_filesComma-separated list of artifact files
project_typeDetected project type (e.g., python-modern, javascript-npm)
project_nameProject name
project_versionProject version
project_pathAbsolute path to project
version_sourceSource file where version was found
version_properties_versionVersion parsed from version.properties; empty when absent
version_properties_matchWhether version.properties matches project_version (true/false; empty when not comparable)
snapshot_versionSynthesized interim version (X.Y.Z-SNAPSHOT convention)
release_filesComma-separated release request files under releases/ (global-jjb / LF release convention); empty when none are present
release_file_countNumber of release request files found under releases/
is_release_readyReturns true when at least one release request file is present under releases/ (drives the promote/tag lane)
release_versionVersion parsed from a lone release file; empty when several exist (the caller disambiguates via changed files)
release_refGit ref parsed from a lone release file; empty when several exist
versioning_typeVersioning type: 'static' or 'dynamic'
build_timestampBuild timestamp (ISO 8601)
git_shaGit commit SHA
git_branchGit branch name
git_tagGit tag (if on a tag)
ci_platformCI platform (github, gitlab, circleci, etc.)
ci_run_idCI run ID
ci_run_urlCI run URL
runner_osRunner operating system
runner_archRunner architecture
python_package_namePython package name
python_requires_pythonRequired Python version
python_build_backendPython build backend
python_metadata_sourceSource of Python metadata (pyproject.toml, setup.py, etc.)
python_versioning_typePython versioning type: 'static' or 'dynamic'
python_matrix_jsonPython version matrix as JSON
python_build_versionRecommended Python version for building (latest from matrix)
python_dynamic_providerWhen versioning_type is dynamic, identifies the provider responsible for resolving the version at build time (pbr, setuptools-scm, versioneer, setuptools-dynamic, runtime-attr).
python_requires_python_fallbacktrue when the action could not determine a Python version from the project metadata and resorted to the canonical default matrix. Consumers should surface this as a warning to the user.
python_requires_python_sourceSource from which the supported-Python-version list was derived. One of: "requires-python" - derived from [project].requires-python (pyproject) or python_requires (setup.cfg / setup.py); "classifiers" - derived from PEP 301 trove classifiers; "poetry-dependencies" - derived from [tool.poetry.dependencies].python in pyproject.toml; "static-fallback" - no version signal was found and the action fell back to its hard-coded supported set; "out-of-range-fallback" - the constraint parsed cleanly but matched no Python version supported by this action (e.g. requires-python = ">=4.0"); the action widened the matrix to the supported set so the workflow could proceed and emitted a ::warning:: plus a $GITHUB_STEP_SUMMARY entry; "parse-error-fallback" - the constraint failed to parse (e.g. a malformed PEP 440 specifier); the action widened the matrix to the supported set as a defensive fallback and emitted a ::warning:: so the user sees the parse failure; empty - the extractor was not invoked (non-Python project).
python_version_unresolvedtrue when the project version is dynamic but cannot be resolved without a build-time signal (e.g. PBR without a tag or PBR_VERSION).
python_dependencies_sourceSource from which the dependency list was loaded (typically "requirements.txt" for projects that delegate install_requires).
python_eol_versionsSpace-separated list of Python versions in the resolved matrix that the live endoflife.date API marks as end-of-life. Versions below the action's baseline floor (see pyversions.Baseline()) can never appear here because they are not in the supported set in the first place; this output surfaces matrix versions that have reached EOL since they entered the supported set. Empty when offline mode is selected, when the live API is unreachable, or when no EOL version intersects the matrix. Consumers (typically python-build-action) can branch on this to warn, strip, or fail their own build steps.
python_eol_versions_present"true" when python_eol_versions is non-empty (one or more EOL versions are in the resolved matrix); "false" otherwise. Provided as a stable boolean for workflow `if:` predicates so consumers do not need to test the string for emptiness. Empty (not "false") when the Python extractor is not invoked -- e.g. for non-Python projects -- because `cmd/build-metadata/main.go` only emits `python_*` outputs for the detected language. Consumers running against mixed-language repos should therefore default to treating an empty value as "no EOL hits".
python_project_match_packageWhether Python project name matches package name
project_match_repoWhether project name matches repository name
javascript_package_nameJavaScript package name
javascript_package_managerDetected package manager (npm, yarn, pnpm, bun)
javascript_lock_fileLock file name
javascript_has_lock_fileWhether lock file exists
javascript_module_typeModule type (module, commonjs)
javascript_requires_nodeRequired Node.js version
javascript_is_workspaceWhether project is a workspace/monorepo
javascript_has_typescriptWhether project uses TypeScript
java_group_idJava/Maven group ID
java_artifact_idJava/Maven artifact ID
java_packagingJava/Maven packaging type (jar, war, pom, etc.)
java_metadata_sourceSource of Java metadata (pom.xml, build.gradle, etc.)
java_has_parentWhether Maven project has a parent POM
java_is_multi_moduleWhether Maven project is multi-module
java_module_countNumber of Maven modules
java_build_dslGradle build DSL (groovy or kotlin)
java_is_multi_projectWhether Gradle project is multi-project
java_versionRequired Java version
java_version_sourceWhere the Java version was detected (e.g. maven.compiler.release, maven-compiler-plugin/release, module:<name>, toolchain)
java_frameworksDetected Java frameworks (Spring Boot, Quarkus, etc.)
go_base_nameFriendly project name derived from the Go module path (the final path element, with any semantic import versioning /vN suffix stripped, e.g. github.com/user/repo/v2 -> repo)
go_module_pathGo module path declared in go.mod
go_go_versionMinimum Go version declared in go.mod (go directive)
go_metadata_sourceSource of Go metadata (go.mod)
go_toolchainToolchain directive from go.mod (empty when absent)
go_dependenciesComma-separated list of direct dependencies in module@version form
go_indirect_dependenciesComma-separated list of indirect dependencies in module@version form
go_dependency_countNumber of direct dependencies
go_total_dependency_countTotal number of dependencies (direct plus indirect)
go_dependency_mapJSON object mapping each dependency module to its version
go_replace_directivesJSON array of replace directives from go.mod, each an object with 'old' and 'new' keys
go_replace_countNumber of replace directives in go.mod
go_exclude_directivesComma-separated list of exclude directives from go.mod
go_exclude_countNumber of exclude directives in go.mod
go_retract_directivesComma-separated list of retract directives from go.mod
go_retract_countNumber of retract directives in go.mod
go_frameworksComma-separated list of detected Go frameworks and tools (Gin, Cobra, gRPC, Testify, etc.)
go_go_version_matrixComma-separated list of Go versions to test against: the supported (non-EOL) Go releases at or above the go.mod minimum. Sourced live from endoflife.date with a static fallback when the API is unreachable.
go_matrix_jsonGo version test matrix as JSON, ready for workflow matrix strategies (e.g. {"go-version": ["1.25", "1.26"]})
successWhether extraction succeeded