You are reading documentation for 0.6.0. The latest release in the 0.6 line is 0.6.1.
The latest stable release is 0.8.4.
Configuration Reference
The action is available in two build-tool-specific variants that share most inputs:
- Gradle —
buildish-tooling/buildish-mammoth-cache/actions/github/gradle@<sha> - Maven —
buildish-tooling/buildish-mammoth-cache/actions/github/maven@<sha>
All inputs described in Common inputs apply to both. Inputs described under Gradle-only inputs or Maven-only inputs are accepted only by the corresponding action and ignored (or rejected) by the other.
The following compact matrix is generated from the typed public contract. The detailed sections below add examples and rationale; the parity test ensures metadata, readers, config-file keys, runtime outputs, and these reference rows cannot silently diverge.
Canonical input matrix
| Input | Action | Default | Config file | Meaning |
|---|---|---|---|---|
config-file |
Gradle, Maven | event-dependent or unset |
no | Optional workspace-relative JSON or YAML configuration file. Direct action inputs override file values; secrets and GitHub context inputs are direct-only. |
base-directory |
Gradle, Maven | . |
yes | Repository-relative project base directory. Rooted paths and paths that escape the workspace are rejected. |
cache-enabled |
Gradle, Maven | true |
yes | Enables cache orchestration. Accepted values: true or false. |
overlay-fs |
Gradle, Maven | true |
yes | Allows OverlayFS for eligible cache operations. Set to false to use the ordinary cache path. |
dependency-cache-layer |
Gradle | true |
yes | Enables eligible Gradle wrapper workers to use a dependency seed and selects a family whose publishers retain eligible partitions. All cooperating jobs use the same value. |
export-layer-environment |
Gradle | true |
yes | Exports the activated Gradle dependency seed as GRADLE_RO_DEP_CACHE for later steps. False emits only the seed-path output; the workflow configures every consumer. |
read-only |
Gradle, Maven | event-dependent or unset |
yes | Disables cache and delta writes. Pull-request events default to true; repository config may make the policy stricter, but only a direct workflow input may lower that floor. |
job-mode |
Gradle, Maven | standalone |
yes | Cache coordination mode: standalone, distributed-worker, distributed-aggregator, or prepare-only. |
dependent-jobs |
Gradle, Maven | event-dependent or unset |
yes | Comma- or newline-separated worker job names consumed by a distributed aggregator. |
worker-artifact-retention-days |
Gradle, Maven | 7 |
yes | Requested worker artifact retention in whole days (1–400). Backend limits may shorten it; shorter retention narrows the retry window. |
allow-duplicate-dependent-delta-paths |
Gradle, Maven | false |
yes | Allows a distributed aggregator to resolve non-identical overlapping worker paths by newest modification time. Exact same-content overlaps remain safe without this option. |
allow-missing-dependent-jobs |
Gradle, Maven | true |
yes | Lets a distributed aggregator merge the available workers when a dependent job uploaded no artifact, for example because it was skipped. A missing job prevents full sweep coverage. Set to false to fail aggregation instead. |
cache-key-prefix |
Gradle, Maven | buildish-mammoth-cache- |
yes | Namespace prefix for action-owned cache families; build, partition, ref-lineage, and generation identity are appended automatically. |
cache-partitions |
Gradle, Maven | event-dependent or unset |
yes | JSON array of cache partition overrides and custom partitions. Hard safety exclusions remain non-overridable. |
cache-max-directory-entries |
Gradle, Maven | 100000 |
yes | Maximum direct entries per managed directory. Must be a positive safe integer. |
cleanup-enabled |
Gradle, Maven | true |
yes | Enables restore cleanup and timestamp garbage collection. |
restore-cleanup-mode |
Gradle, Maven | none |
yes | Restore-time cleanup mode: none or prune-managed. |
cache-gc-mode |
Gradle, Maven | timestamp |
yes | Managed-cache GC: timestamp uses file age and current-build activity; off disables deletion only. |
cache-gc-older-than-days |
Gradle, Maven | 14 |
yes | File-mtime age threshold for timestamp GC, not historical inactivity. Must be at least 2 days. |
dependency-gc-interval-days |
Gradle, Maven | 3 |
yes | Days between completed periodic GC sweeps. |
dependency-gc-force-grace-days |
Gradle, Maven | 1 |
yes | Additional days before an aggregator can sweep with incomplete worker coverage. Use off to disable forcing. |
github-token |
Gradle, Maven | event-dependent or unset |
no | Optional GitHub token for authenticated API requests. Pass secrets directly, never through repository config. |
github-job-check-run-id |
Gradle, Maven | event-dependent or unset |
no | Optional check-run ID used to create a direct current-job link. |
github-event-name |
Gradle, Maven | event-dependent or unset |
no | Optional triggering-event override for reusable workflows. Pass the trusted caller event. |
github-job-name |
Gradle, Maven | event-dependent or unset |
no | Optional stable job-name override used for distributed artifact coordination. |
github-ref-name |
Gradle, Maven | event-dependent or unset |
no | Optional resolved-ref override for reusable workflows. |
github-default-branch |
Gradle, Maven | event-dependent or unset |
no | Optional repository default-branch override for reusable workflows. |
process-all-wrapper-files |
Gradle | false |
yes | Processes every matching Gradle wrapper properties file. Cannot be combined with wrapper-properties-files. |
wrapper-properties-glob |
Gradle | **/gradle/wrapper/gradle-wrapper.properties |
yes | Repository-relative Gradle wrapper properties discovery glob. |
wrapper-properties-files |
Gradle | event-dependent or unset |
yes | Comma- or newline-separated explicit Gradle wrapper properties files relative to base-directory. |
gradle-user-home |
Gradle | event-dependent or unset |
yes | Gradle user home to manage. The current version accepts only the runner default. |
setup-java |
Gradle | false |
yes | Reserved compatibility flag. The current version rejects true; run actions/setup-java first. |
maven-user-home |
Maven | event-dependent or unset |
yes | Absolute or working-directory-relative Maven user home to manage, including repository/ and wrapper/dists/; defaults to MAVEN_USER_HOME or ~/.m2. |
Canonical output matrix
| Output | Meaning |
|---|---|
gradle-ro-dep-cache |
Invocation-owned Gradle read-only dependency cache path, or empty when layered restore is inactive. |
cache-family-key |
Stable compatibility family shared by structurally compatible generations. |
cache-lineage-prefix |
Current-ref prefix used to restore the newest immutable generation. |
base-cache-restore-status |
Classified base-cache restore outcome for prepare. |
dependency-gc-due |
Whether periodic GC is due for the selected generation. Values are true, false, or unknown. |
restored-cache-key |
Exact immutable generation restored during prepare, when any. |
read-only |
Whether cache and delta writes are disabled. |
job-mode |
Effective standalone or distributed job mode. |
dependent-delta-status |
Dependent-delta outcome: not-configured, applied, or skipped-read-only. |
dependent-delta-artifact-count |
Number of dependent worker artifacts applied during prepare. |
Common inputs
config-file
- Default: unset
- Optional workspace-relative
.json,.yml, or.yamlfile containing a top-level object. - Config-file keys use the same kebab-case names as the action inputs.
- Direct action inputs override values loaded from the file.
dependent-jobsandwrapper-properties-filesmay be either strings or arrays in the file.cache-partitionsmay be expressed as a native YAML/JSON array in the file instead of a serialized JSON string.github-tokenis intentionally rejected in config files; pass secrets directly via action inputs or environment variables.- The resolved file must remain inside the workspace after symlink resolution.
base-directory
- Default:
. - Repository-relative base directory for wrapper discovery and other project-relative paths.
- Windows-style relative paths using
\are accepted and normalized to internal POSIX-style paths. - Absolute/rooted paths are rejected, including
C:\repo,\Windows\System32, and\\server\share. - Must remain inside the repository workspace.
cache-enabled
- Default:
true - Accepted values:
true,false - Enables or disables cache orchestration.
overlay-fs
- Defaults to
true. Acceptstrueorfalse. - Set
overlay-fs: falsein the action inputs or repository configuration to skip mount probing and allow eligible Gradle workers to use the read-only seed while GC is fresh. - Eligible warm, writable Linux Gradle wrapper workers try OverlayFS while GC is fresh. Mammoth mounts the job’s Gradle user home and uses the upper layer to find changes. It captures affected workspaces from the merged view and captures complete dependency metadata for the designated writer.
- Existing unmanaged files remain visible to the build. Post unmounts the home and discards the
build’s local changes after cache capture. Use
overlay-fs: falseif you need those changes to remain on disk after post. - An eligible warm, writable Linux Maven worker mounts only the local
repository/directory undermaven-user-home. Maven settings and wrapper distributions use their usual paths. Mammoth captures complete changed coordinates, including repository-origin records, then unmounts and discards the worker’s local repository changes. Useoverlay-fs: falseto keep the ordinary repository lifecycle. - OverlayFS workers can miss reads of inherited files. Their usage is ineligible for a periodic sweep.
- Warm, writable standalone and aggregator jobs can also use OverlayFS. Publishers use the
ordinary path when timestamp GC is active, restore cleanup prunes managed files, or enabled
cleanup has purge rules. Post discards local writes within the mount after publication. Set
overlay-fs: falseto keep those writes on disk after post. - On GitHub-hosted Linux, Mammoth uses noninteractive
sudofor mount operations. On other Linux runners, it uses the action process’s existing permissions. After a recoverable mount failure, Mammoth uses the ordinary writable cache path. - Mammoth requests the default
fsync=autobehavior explicitly on Linux 7.0 and newer. Earlier kernels use their default sync behavior.
read-only
- Default: event-dependent
- Accepted values:
true,false - Defaults to
trueforpull_request/pull_request_target. - Defaults to
falsefor other events. - A repository config file may set
true, but cannot setfalseto lower the pull-request safety floor. Only a direct workflow input can make that explicit trusted-workflow choice. - Prevents remote cache publication and workflow-artifact exchange.
- Post skips cache activity scans and publication. Activity statistics are reported as unavailable. Snapshot counts describe prepare.
- Local restore/extraction, snapshot replacement and integrity validation, provisioning, hooks, build reports and bounded lifecycle records remain active. Local cache files remain writable.
job-mode
- Default:
standalone - Supported values:
standalonedistributed-workerdistributed-aggregatorprepare-only
- Controls cache coordination behavior.
- Use
prepare-onlyin a planning job to emitdependency-gc-duebefore selecting worker jobs. It reads only the generation record and skips cache installation, build-tool provisioning, and cache publication. See periodic GC in distributed jobs for wiring the output into a workflow.
dependent-jobs
- Comma- or newline-separated Mammoth job names consumed by a distributed aggregator.
- Defaults to empty. Mammoth uses the list both to select ordinary worker envelopes and to check
coverage for a complete periodic sweep. List every worker, including conditional ones; see
allow-missing-dependent-jobsfor jobs that did not upload. - Use the workflow job IDs or the exact names supplied by
github-job-name. An empty list cannot establish full coverage. See periodic GC in distributed jobs.
worker-artifact-retention-days
- Default:
7 - Positive whole-number days from
1to400. Repository, organization, and backend limits may shorten the requested period; availability for the full period is not guaranteed. - Applies to new distributed worker artifact uploads for both Gradle and Maven. Producers may request different periods without affecting cache identity or envelope compatibility.
- Shorter retention reduces artifact residence and narrows the selective or aggregator-only retry window. Expired workers must be rerun before aggregation can succeed.
- Successful aggregation retains worker envelopes. Base cache expiry and timestamp GC are independent.
- For a one-day example, see distributed jobs.
cache-key-prefix
-
Default:
buildish-mammoth-cache- -
Must start with an alphanumeric character.
-
Remaining characters may only be letters, numbers,
.,_, or-. -
Changes only the namespace prefix. The action always appends build tool, schema, partition, storage-format, ref-lineage, and immutable-generation identity.
-
OS and architecture share by default for both tools. To isolate them, use a workflow input:
1cache-key-prefix: project-${{ runner.os }}-${{ runner.arch }}- -
Every participating worker and aggregator must resolve the same prefix to share. GitHub expressions belong in workflow YAML; config-file strings are literal.
-
Maven local installs with environment-dependent bytes at identical coordinates require distinct coordinates or an explicitly isolated prefix. Java versions share by default too; include a chosen Java identity in the prefix when needed.
cache-partitions
- Default: empty
- Optional JSON array of cache partition overrides and custom partitions.
- In
config-file, this may also be a native YAML/JSON array instead of a serialized string. - Each object must contain:
id: lowercase letters, numbers, and-onlyincludes: array of cache-root-relative include globsexcludes: optional array of cache-root-relative exclude globs
- Overriding a built-in partition replaces its built-in include/exclude lists.
- Setting
includes: []disables a built-in partition. - Custom partitions must have at least one include glob.
- Hard safety excludes are always enforced even when a partition is overridden.
cache-max-directory-entries
The default is 100000. Set a positive safe integer as a workflow input or in
config-file. A direct workflow value takes precedence. Main records the value
for post so the same invocation uses one limit.
The limit applies to direct children of each enumerated directory. Native listings count entries before filtering them. Merged and staged views also have per-directory bounds. A directory beyond the limit fails the affected phase with its logical path and the configured allowance. Narrow managed directories or increase the allowance when the diagnostic indicates directory breadth.
For an ordinary aggregate Gradle base restore, a read-only job or distributed worker can move an intact staged directory without listing its descendants. The limit applies to directories that restore actually enumerates, including merge boundaries. A writable standalone job or aggregator also enumerates restored entries when building the publication comparison, so it can hit the limit deeper in the same cached subtree.
The active name and decoded-record working budgets are independent of this setting. Wide, deep, long-name or high-fan-in workloads can exhaust those budgets at a lower entry count. This input gives no repository-wide file limit or process memory guarantee.
cleanup-enabled
- Default:
true - Accepted values:
true,false - Enables restore cleanup and timestamp garbage collection. When
false, both are skipped even if their individual modes request cleanup.
cache-gc-mode
- Default:
timestamp - Supported values:
off,timestamp timestampenables periodic sweeps of inherited files in managed aggregate partitions before a writable standalone or aggregator job saves the base cache. A sweep can evict an old file when capture observed no activity. The existing worker-local cleanup and single-writer snapshot rules still apply.- Activity is best effort. It uses ctime, mtime, and atime relative to the post-prepare cutoff. Filesystem or clock behavior can hide access. Gradle or Maven build-cache hits can also skip work that would have read a dependency. GC can then evict a dependency that a later build needs to download again.
offdisables timestamp eviction and reports GC as fresh. Tracking, exchange, and otherwise required publication continue.- Set
offwhen jobs must retain rarely used old cache entries, for example offline-style builds that cannot redownload pruned dependencies.
cache-gc-older-than-days
- Default:
14 - Minimum:
2 - Age threshold for
cache-gc-mode: timestamp. - Grace measures file age, not historical inactivity. Deferred/coalesced atime and
noatimecan hide current use. - Increase this value if your Gradle or Maven build uses a large dependency set with artifacts that are valid but touched infrequently.
dependency-gc-interval-days
- Default:
3. Accepts a positive duration in days, including fractions. - Measured from the last completed sweep in the selected cache generation. A generation with no recorded completion is due immediately. When restore falls back to the default ref, the schedule uses that generation’s timestamp.
- A successful sweep advances the timestamp even if every partition object can be reused. Ordinary publication carries the previous timestamp forward.
dependency-gc-force-grace-days
- Default:
1. Accepts a nonnegative duration in days, including fractions, oroff. - An aggregator can sweep with incomplete coverage after this grace period elapses past the
regular due time. With the defaults that is four days after the last completed sweep.
0allows forcing as soon as GC is due. A generation with no recorded completion can be forced immediately unless forcing isoff. - A forced sweep still requires an admitted base, usable writable capture, and successful publication. The aggregator still applies its ordinary worker artifact requirements.
restore-cleanup-mode
- Default:
none - Supported values:
none,prune-managed prune-managedonly acts after a base-cache hit.- It can remove managed leftovers covered by the selected, validated restore. Prepare rejects preexisting managed files independently of this setting. A missing object leaves that partition cold and supplies no cleanup authority.
- It never deletes files outside the action-managed partition space.
- It is intentionally an opt-in because it is more destructive and may increase restore time.
allow-duplicate-dependent-delta-paths
- Default:
false - Accepted values:
true,false - When
true, the aggregator resolves non-identical overlapping worker paths by newest modification time. - Exact same-content overlaps merge safely without this option.
- When
false, non-identical path conflicts are errors. - Only relevant for distributed aggregator jobs.
For Maven files under repository/, directory consistency takes precedence: workers updating the
same directory must provide identical managed path sets, content, and sizes by default. This option
cannot select a newer conflicting origin marker or combine different directory views. See
Maven caching patterns.
allow-missing-dependent-jobs
- Default:
true - Accepted values:
true,false - When
true, a distributed aggregator warns about each job independent-jobsthat uploaded no envelope, for example because it was skipped, failed before the Mammoth step, or was cancelled before its post step. It merges the available envelopes. Snapshot partitions of a missing writer keep the previous snapshot. - A missing job always prevents full sweep coverage, so no complete sweep runs in that execution. A forced sweep after the grace period still applies.
- When
false, a missing envelope fails aggregation. Use it to detect a misspelled job name or a missingneedsentry early. - Malformed, ambiguous or incompatible envelopes always fail aggregation.
- Only relevant for distributed aggregator jobs.
Partition publication and metadata writers
The existing cache-partitions input also accepts publication and writer on individual entries.
Gradle’s enabled dependency-metadata preset defaults to single-writer; other partitions use
aggregate. A standalone job is automatically its own writer. For distributed jobs, put this same
configuration in every participating job, preferably using a shared config file:
1cache-partitions:
2 - id: dependency-metadata
3 writer: worker-a
Omit includes and excludes to inherit the built-in patterns. Explicit lists replace the
corresponding defaults; an empty include list disables a built-in. Custom partitions must supply
nonempty includes and can opt into publication: single-writer with their own writer.
A writer is a trimmed producer identity, including an explicit github-job-name when supplied.
Matrix jobs must have distinct producer identities.
writer identifies an optional snapshot contribution. It does not make an entry in
dependent-jobs optional. If a job is also listed there for ordinary artifacts, its envelope remains
required. See the distributed guide for complete
workflows, skipped writers, fallback, and configuration compatibility.
Partition conflict handling
Each cache-partitions entry accepts conflict-handling: default,
choose-worker-directory, or choose-worker-entry. Omission inherits the preset
policy. The built-in Gradle groovy-dsl, kotlin-dsl and transforms-metadata partitions default to
choose-worker-directory; build-cache defaults to choose-worker-entry.
Other built-ins and custom partitions default to strict handling. Explicit
default clears an inherited selection policy.
1cache-partitions:
2 - id: repository
3 conflict-handling: choose-worker-directory
choose-worker-directory supports aggregate Maven partitions whose include
globs all start with repository/, and aggregate Gradle partitions whose includes select DSL/transform workspaces or the
ordinary legacy-script/generated-API-JAR paths in the built-in Kotlin partition.
Selection applies only to recognized workspace roots; ordinary files remain strict. Configure the same
policy in every producer and aggregator. The effective policy changes the partition
fingerprint and cache family.
For Gradle DSL and transform caches, the unit is the complete hashed workspace, including its
metadata, output files and empty output directories. Groovy requires both metadata
files; Kotlin uses its layout-specific required outputs; transforms require nonempty
metadata.bin, regular results.bin and transformed/. Conflicting producers are selected
by the job-name ordering below. Losing views are discarded. The selected complete
workspace replaces existing managed contents; excluded or unmanaged target
obstacles fail before replacement. Partial-workspace overrides and single-writer
publication are unsupported. default keeps whole-workspace transport but rejects
conflicting views. See cache partitions for capture and GC.
choose-worker-entry supports aggregate Gradle build-cache partitions with
includes rooted at caches/build-cache-*/ or a literal numeric format directory.
It selects one unchanged archive per direct 32-lowercase-hex key under
caches/build-cache-<number>/. Other filenames retain ordinary strict handling.
Different keys can come from different producers. Both Gradle selection policies
use the smallest producer job name in JavaScript UTF-16 ordinal order, independent
of package arrival and modification times, and take precedence over
allow-duplicate-dependent-delta-paths. Explicit strict overrides also take
precedence for recognized workspace/archive collisions.
These policies also select a winner if actual outputs differ under the same key.
They assume correctly declared, reproducible Gradle work; Mammoth does not compare
archive contents semantically or rewrite origin metadata. Use default to reject
such conflicts. Portable file permissions still apply to the selected view.
For Maven, the following directory rules apply.
For each immediate repository directory, choose the complete contribution from the producer with the smallest job name in JavaScript UTF-16 ordinal order. Discovery first selects each producer’s newest eligible attempt. File arrival order, modification times and attempt numbers across different producers do not set priority. Differing directory membership counts as a conflict too.
The winner supplies all files and their attributes, subject to normal portable
permissions. Other producers’ files for that directory are discarded. Marker
contents are neither parsed nor merged. This directory policy takes precedence
over allow-duplicate-dependent-delta-paths. Usage-only contributions cannot win.
Directories spanning partitions must use one consistent policy; single-writer
snapshot partitions cannot use this mode.
Selection can lose classifiers, origin entries or local installs supplied only by another worker. Offline builds may fail, and a discarded local install may have no remote copy. Different directories may select different workers, so this is not a snapshot of the entire Maven repository. A forwarding worker republishes its selected view under its own job identity; priority is per merge stage.
Existing aggregator files absent from the winning directory still cause an error before worker upserts, including files excluded from caching. This mode does not delete target siblings or add exact directory replacement. Diagnostics report resolved conflicts with bounded winner/discarded-producer details.
github-token
- Default: unset (falls back to
GITHUB_TOKENwhen available) - Used for authenticated requests to the configured GitHub API host. The Gradle action uses these headers for authenticated wrapper downloads; provider integrations may also use them.
- Direct-only: config files reject this secret-bearing input.
- Never written to summaries or persisted post-action state.
github-event-name
- Default: unset (the action reads
GITHUB_EVENT_NAMEfrom the runner environment) - Reusable workflows only. When a workflow is triggered via
workflow_call, GitHub setsGITHUB_EVENT_NAMEtoworkflow_callrather than the original caller’s event name. Pass${{ github.event_name }}from the caller workflow to restore the correct value. - Affects
isPullRequestdetection and the default read-only behavior on pull-request events. - Example:
1github-event-name: ${{ github.event_name }}
github-job-name
- Default: unset (the action reads
GITHUB_JOBfrom the runner environment) - Reusable workflows and matrix jobs. Assigns a stable, predictable job name for cache coordination and artifact naming, independent of the GitHub Actions job key or matrix label.
- Example:
1github-job-name: aggregator
github-ref-name
- Default: unset (the action resolves the ref name from
GITHUB_REF_NAME,GITHUB_REF, and the event payload) - Reusable workflows only. When a workflow is triggered via
workflow_call, the ref context visible inside the reusable workflow may differ from the caller’s. Pass the resolved ref name from the caller workflow to ensure cache keys use the correct branch or tag. - Example:
1github-ref-name: ${{ github.ref_name }}
github-default-branch
- Default: unset (the action reads the default branch from the event payload or
GITHUB_DEFAULT_BRANCH) - Reusable workflows only. Pass the caller’s default branch so that cache key fallbacks target the correct base branch.
- Example:
1github-default-branch: ${{ github.event.repository.default_branch }}
Outputs
Both actions expose the same cache lifecycle outputs after prepare:
| Output | Meaning |
|---|---|
cache-family-key |
Structural compatibility family, without ref or generation identity |
cache-lineage-prefix |
Current-ref prefix used for newest-generation restore |
base-cache-restore-status |
feature-unavailable, miss, current-lineage-hit, fallback-lineage-hit, current-lineage-partial-hit, or fallback-lineage-partial-hit |
restored-cache-key |
Selected generation with at least one restored/explicit-empty partition, or empty on a miss |
read-only |
Effective write policy as true or false |
job-mode |
Effective mode for ordinary prepare |
dependency-gc-due |
Whether a sweep is due for the selected generation, as true, false, or unknown |
dependent-delta-status |
not-configured, applied, or skipped-read-only |
dependent-delta-artifact-count |
Number of worker artifacts applied during prepare |
On a cold retry, a reused frozen miss means no base was selected; it does not imply
another service lookup. Historical backend unavailability is not stored solely for
reporting. Freshly observed unavailability reports feature-unavailable. A generation
whose partitions are all missing is also a miss with no restored key; an explicitly
empty partition counts as a successful restore.
dependency-gc-due is available in all job modes, including read-only jobs. true means the
generation is due. false means it is fresh or timestamp GC is disabled. unknown means no
generation record could be selected and admitted. An admitted record supplies the due signal
even if its partition objects are missing. prepare-only emits only this output. Each participant
checks the generation it selects during its own prepare.
Generation keys are finalize outcomes and are intentionally not planned prepare outputs. The job summary and finalize log report the exact key only after a successful publication.
Gradle-only inputs
dependency-cache-layer
- Default:
true. - Use the same value in every cooperating publisher and worker. It selects a distinct cache family. Periodic GC applies to aggregate dependency partitions within that family.
- Set
falseacross cooperating jobs to use the ordinary Gradle cache family. Upgrading an ordinary family to the new default starts the layered family cold unless caches from a previous opt-in are available. - Activation requires a writable distributed worker, a selected wrapper,
restore-cleanup-mode: none, no selected single-writer ownership, and both dependency partitions in the supported layout. Other cases use the full ordinary installation. Gradle chooses which restored metadata it can use. - Direct true/false values override config-file true/false values. The runtime applies the default after merging inputs so a config-file opt-out takes effect.
- See Gradle dependency layer for the consumer contract.
export-layer-environment
- Default:
true, resolved at runtime so config-file false is honored. Direct true/false values override the file; absence in both places enables export. - Active prepare emits
gradle-ro-dep-cacheand normally exportsGRADLE_RO_DEP_CACHEfor subsequent steps. False emits only the output; configure that environment variable on every consuming Gradle step yourself. Inactive prepare emits an empty output. - An existing nonempty
GRADLE_RO_DEP_CACHEconflicts with eligible layered prepare and fails before provisioning or backend access.
process-all-wrapper-files
- Default:
false - Accepted values:
true,false - Scans for every matching wrapper properties file under
base-directory. - Cannot be combined with
wrapper-properties-files.
wrapper-properties-glob
- Default:
**/gradle/wrapper/gradle-wrapper.properties - Repository-relative discovery glob used beneath
base-directory. - Windows-style relative paths using
\are accepted and normalized before evaluation. - Absolute/rooted paths are rejected, including drive-prefixed, rooted, and UNC paths.
wrapper-properties-files
- Default: empty
- Comma- or newline-separated explicit
gradle-wrapper.propertiesfiles. - Paths are relative to
base-directory. - Windows-style relative paths using
\are accepted and normalized to internal POSIX-style paths. - Absolute/rooted paths are rejected, including drive-prefixed, rooted, and UNC paths.
- Entries must be explicit file paths, not globs.
gradle-user-home
- Default:
$GRADLE_USER_HOMEwhen set, otherwise$HOME/.gradle - To use a dedicated home, set
GRADLE_USER_HOMEfor both the action and the build. If you also supplygradle-user-home, its resolved path must match that environment value, or the runner default when the environment variable is unset. - Put required user-home
gradle.propertiesand init scripts in the selected home, or supply their configuration explicitly. Keep them outside enabled partitions. - Use a fresh dedicated home per invocation on persistent runners. Mammoth keeps
local state and staging in a sibling
.mammoth.<id>directory. The parent must be writable by the runner and the home and sibling must share a filesystem. Keep the sibling through post.
setup-java
- Default:
false - Reserved compatibility flag. In v1, setting
truefails intentionally. - Run
actions/setup-javabefore this action instead.
Maven-only inputs
maven-user-home
- Default:
$MAVEN_USER_HOMEwhen set, otherwise$HOME/.m2 - Accepts an absolute path or a path resolved from the action process working directory.
- The managed root contains both the Maven local repository at
repository/and Maven Wrapper distributions atwrapper/dists/; do not pass therepository/directory itself. - Configure Maven itself to use
-Dmaven.repo.local=<home>/repository(or the equivalentlocalRepositorysetting). Maven Wrapper usesMAVEN_USER_HOMEfor its distribution base. To use a settings file in the dedicated home, pass its path with-s. - The managed area must start empty. Keep the selected home exclusive through prepare, build and post. See dedicated-home examples.
- Use a fresh dedicated home per invocation on persistent runners. Mammoth keeps
local state and staging in a sibling
.mammoth.<id>directory. The parent must be writable by the runner and the home and sibling must share a filesystem. Keep the sibling through post.
Distributed mode wiring example
The snippets below show the minimum input wiring needed to connect two worker jobs to an
aggregator. The github-job-name input gives each job a stable, human-readable name that is
independent of matrix labeling; the aggregator’s dependent-jobs must list exactly those names.
See Distributed Multi-Job Builds for a full explanation of how the delta exchange works and for additional configuration options.
Gradle
1jobs:
2 worker-a:
3 runs-on: ubuntu-latest
4 permissions:
5 contents: read
6 steps:
7 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
8 - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
9 with: { distribution: temurin, java-version: '21' }
10 - uses: buildish-tooling/buildish-mammoth-cache/actions/github/gradle@<commit-sha>
11 with:
12 job-mode: distributed-worker
13 github-job-name: worker-a # stable name used by the aggregator
14 cache-key-prefix: my-project-gradle-
15 - run: ./gradlew :module-a:build
16
17 worker-b:
18 runs-on: ubuntu-latest
19 permissions:
20 contents: read
21 steps:
22 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
23 - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
24 with: { distribution: temurin, java-version: '21' }
25 - uses: buildish-tooling/buildish-mammoth-cache/actions/github/gradle@<commit-sha>
26 with:
27 job-mode: distributed-worker
28 github-job-name: worker-b
29 cache-key-prefix: my-project-gradle-
30 - run: ./gradlew :module-b:build
31
32 aggregator:
33 needs: [worker-a, worker-b]
34 if: ${{ always() && github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}
35 runs-on: ubuntu-latest
36 permissions:
37 contents: read
38 steps:
39 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
40 - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
41 with: { distribution: temurin, java-version: '21' }
42 - uses: buildish-tooling/buildish-mammoth-cache/actions/github/gradle@<commit-sha>
43 with:
44 job-mode: distributed-aggregator
45 dependent-jobs: worker-a, worker-b # must match github-job-name on each worker
46 github-job-name: aggregator
47 cache-key-prefix: my-project-gradle-
Maven
1jobs:
2 worker-a:
3 runs-on: ubuntu-latest
4 permissions:
5 contents: read
6 steps:
7 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
8 - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
9 with: { distribution: temurin, java-version: '21' }
10 - uses: buildish-tooling/buildish-mammoth-cache/actions/github/maven@<commit-sha>
11 with:
12 job-mode: distributed-worker
13 github-job-name: worker-a
14 cache-key-prefix: my-project-maven-
15 - run: mvn -pl module-a verify
16
17 worker-b:
18 runs-on: ubuntu-latest
19 permissions:
20 contents: read
21 steps:
22 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
23 - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
24 with: { distribution: temurin, java-version: '21' }
25 - uses: buildish-tooling/buildish-mammoth-cache/actions/github/maven@<commit-sha>
26 with:
27 job-mode: distributed-worker
28 github-job-name: worker-b
29 cache-key-prefix: my-project-maven-
30 - run: mvn -pl module-b verify
31
32 aggregator:
33 needs: [worker-a, worker-b]
34 if: ${{ always() && github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}
35 runs-on: ubuntu-latest
36 permissions:
37 contents: read
38 steps:
39 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
40 - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
41 with: { distribution: temurin, java-version: '21' }
42 - uses: buildish-tooling/buildish-mammoth-cache/actions/github/maven@<commit-sha>
43 with:
44 job-mode: distributed-aggregator
45 dependent-jobs: worker-a, worker-b
46 github-job-name: aggregator
47 cache-key-prefix: my-project-maven-