Skip to content
BETAGuardrails are in beta. The library, the configuration format and the CLI command can still change.

Guardrails / build

Dependency updates are automated

build/dependency-updates-configured@v1

The repository configures a tool that opens the dependency update, so upgrades arrive as reviewable pull requests rather than as a task nobody has time for.

Idbuild/dependency-updates-configured
Versionv1
Categorybuild
Default severitywarning
Interpreterpython3
Timeout30 seconds
Violations tolerated0
Collectsfiles

Collectors

This guardrail gathers nothing itself. It depends on the collectors below, which the CLI runs once per build before any check, and reads what they found out of GUARDRAIL_FACTS. A collector that collects nothing skips this guardrail rather than failing it.

CollectorGathersInputs it is given
filesPresence, size and line counts of the well known files a repository is expected to carry, plus any extra path the guardrail asks for.paths

The inputs above are this guardrail's own, passed straight through. Configuring one in buildnote.json changes what is collected, and two guardrails configured the same way share the one collection.

Configuration

json
{
  "guardrails": {
      "failOn": "error",
      "comment": true,
      "checks": [
          {
              "use": "build/dependency-updates-configured@v1",
              "severity": "warning",
              "with": {
                  "paths": ".github/dependabot.yml,.github/dependabot.yaml,renovate.json,renovate.json5,.renovaterc,.renovaterc.json,.github/renovate.json"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs

InputDescriptionDefaultEnvironment variable
pathsComma separated paths, any one of which satisfies the guardrail..github/dependabot.yml,.github/dependabot.yaml,renovate.json,renovate.json5,.renovaterc,.renovaterc.json,.github/renovate.jsonGUARDRAIL_INPUT_PATHS

How to fix

Configure Dependabot with .github/dependabot.yml:

yaml
version: 2
updates:
  - package-ecosystem: gradle
    directory: "/"
    schedule:
      interval: weekly
  - package-ecosystem: github-actions
    directory: "/"
    schedule:
      interval: weekly

Renovate, configured with renovate.json, is the same answer. Either way the upgrade arrives as a pull request the tests run against, which is the only form in which it competes for attention with the rest of the work. An unautomated dependency is upgraded when a vulnerability forces it, which is the worst moment to be moving several major versions at once.

More in build

  • build/gradle-version-floor. The Gradle version the wrapper pins is at or above the floor the team sets, so the build runs on a toolchain that is still supported.
  • build/runs-on-hosted-ci. The artifact was built by a CI platform rather than on somebody's workstation, so the build is attributable and repeatable.
  • build/wrapper-distribution-verified. The Gradle wrapper pins the checksum of the distribution it downloads, so the toolchain cannot be swapped underneath the build.

All 4 build guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412