Skip to content

Add renovate comments to all Earthfile #135

@janishorsts

Description

@janishorsts

In @EarthBuild repositories, @renovate-bot ensures the dependencies are up to date everywhere. However, not all dependencies are determined in the EarthFiles by @renovate-bot.

We use the following regex manager for EarthFile:

{
customType: 'regex',
description: "Update _version ARGs and ENVs in Earthfile",
managerFilePatterns: [
'/^Earthfile$/',
],
matchStrings: [
'#\\s*renovate:\\s*datasource=(?<datasource>[a-z-]+?)(?:\\s+depName=(?<depName>.+?))?\\s+packageName=(?<packageName>.+?)(?:\\s+versioning=(?<versioning>[a-z-]+?))?\\s+(?:ENV|ARG)\\s+.+?(_VERSION|_VER|_version)=(?<currentValue>.+?)\\s',
],
},

Ensure we have the renovate comment where needed.

The comment applies to ENV, LET and ARG commands containing _version= or _VERSION.

    # renovate: datasource=go packageName=golang.org/x/vuln/cmd/govulncheck
    ENV govulncheck_version=1.1.3

    # renovate: datasource=go packageName=golang.org/x/vuln/cmd/govulncheck
    LET govulncheck_version=1.1.3

    # renovate: datasource=go packageName=golang.org/x/vuln/cmd/govulncheck
    ARG govulncheck_version=1.1.3

E.g.

earthbuild/Earthfile

Lines 162 to 164 in bb8204a

# renovate: datasource=go packageName=golang.org/x/vuln/cmd/govulncheck
ENV govulncheck_version=1.1.3
RUN go install golang.org/x/vuln/cmd/govulncheck@v$govulncheck_version

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions