renovate 44.93.7 → 44.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/decrypt.js +3 -1
- package/dist/config/decrypt.js.map +1 -1
- package/dist/config/presets/internal/workarounds.preset.js +2 -2
- package/dist/config/presets/internal/workarounds.preset.js.map +1 -1
- package/dist/modules/datasource/azure-bicep-resource/index.js +4 -2
- package/dist/modules/datasource/azure-bicep-resource/index.js.map +1 -1
- package/dist/modules/datasource/cpan/index.js +1 -0
- package/dist/modules/datasource/cpan/index.js.map +1 -1
- package/dist/modules/datasource/docker/common.js +3 -1
- package/dist/modules/datasource/docker/common.js.map +1 -1
- package/dist/modules/datasource/elm-package/index.js +2 -1
- package/dist/modules/datasource/elm-package/index.js.map +1 -1
- package/dist/modules/datasource/index.js +1 -1
- package/dist/modules/datasource/index.js.map +1 -1
- package/dist/modules/datasource/java-version/index.js +1 -0
- package/dist/modules/datasource/java-version/index.js.map +1 -1
- package/dist/modules/datasource/npm/npmrc.js +1 -1
- package/dist/modules/datasource/npm/npmrc.js.map +1 -1
- package/dist/modules/datasource/ruby-version/index.js +1 -0
- package/dist/modules/datasource/ruby-version/index.js.map +1 -1
- package/dist/modules/datasource/typst/index.js +10 -7
- package/dist/modules/datasource/typst/index.js.map +1 -1
- package/dist/modules/manager/apm/artifacts.js +7 -18
- package/dist/modules/manager/apm/artifacts.js.map +1 -1
- package/dist/modules/manager/bun/artifacts.js +3 -10
- package/dist/modules/manager/bun/artifacts.js.map +1 -1
- package/dist/modules/manager/cargo/artifacts.js +4 -15
- package/dist/modules/manager/cargo/artifacts.js.map +1 -1
- package/dist/modules/manager/cocoapods/artifacts.js +11 -26
- package/dist/modules/manager/cocoapods/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/artifacts.js +8 -19
- package/dist/modules/manager/composer/artifacts.js.map +1 -1
- package/dist/modules/manager/conan/artifacts.js +3 -10
- package/dist/modules/manager/conan/artifacts.js.map +1 -1
- package/dist/modules/manager/copier/artifacts.js +21 -41
- package/dist/modules/manager/copier/artifacts.js.map +1 -1
- package/dist/modules/manager/deno/artifacts.js +5 -18
- package/dist/modules/manager/deno/artifacts.js.map +1 -1
- package/dist/modules/manager/devbox/artifacts.js +3 -10
- package/dist/modules/manager/devbox/artifacts.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +7 -7
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/github-actions/known-actions/crate-dynamic.js +20 -0
- package/dist/modules/manager/github-actions/known-actions/crate-dynamic.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/dart-version.js +13 -0
- package/dist/modules/manager/github-actions/known-actions/dart-version.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/docker-dynamic.js +33 -0
- package/dist/modules/manager/github-actions/known-actions/docker-dynamic.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/docker.js +10 -0
- package/dist/modules/manager/github-actions/known-actions/docker.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/dotnet-version.js +14 -0
- package/dist/modules/manager/github-actions/known-actions/dotnet-version.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/github-release-attachments-dynamic.js +22 -0
- package/dist/modules/manager/github-actions/known-actions/github-release-attachments-dynamic.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/github-releases-dynamic.js +143 -0
- package/dist/modules/manager/github-actions/known-actions/github-releases-dynamic.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/github-releases.js +271 -0
- package/dist/modules/manager/github-actions/known-actions/github-releases.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/gradle-version.js +25 -0
- package/dist/modules/manager/github-actions/known-actions/gradle-version.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/java-version-dynamic.js +51 -0
- package/dist/modules/manager/github-actions/known-actions/java-version-dynamic.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/multiple.js +106 -0
- package/dist/modules/manager/github-actions/known-actions/multiple.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/npm.js +53 -0
- package/dist/modules/manager/github-actions/known-actions/npm.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/pypi.js +27 -0
- package/dist/modules/manager/github-actions/known-actions/pypi.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/ruby-version.js +12 -0
- package/dist/modules/manager/github-actions/known-actions/ruby-version.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/rust-version-dynamic.js +14 -0
- package/dist/modules/manager/github-actions/known-actions/rust-version-dynamic.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/rust-version.js +19 -0
- package/dist/modules/manager/github-actions/known-actions/rust-version.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions/utils.js +93 -0
- package/dist/modules/manager/github-actions/known-actions/utils.js.map +1 -0
- package/dist/modules/manager/github-actions/known-actions.js +33 -728
- package/dist/modules/manager/github-actions/known-actions.js.map +1 -1
- package/dist/modules/manager/github-actions/schema.js +2 -1
- package/dist/modules/manager/github-actions/schema.js.map +1 -1
- package/dist/modules/manager/github-actions/types.js +9 -0
- package/dist/modules/manager/github-actions/types.js.map +1 -0
- package/dist/modules/manager/gleam/artifacts.js +13 -23
- package/dist/modules/manager/gleam/artifacts.js.map +1 -1
- package/dist/modules/manager/gomod/artifacts.js +18 -50
- package/dist/modules/manager/gomod/artifacts.js.map +1 -1
- package/dist/modules/manager/helmfile/artifacts.js +16 -22
- package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
- package/dist/modules/manager/helmv3/artifacts.js +8 -28
- package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
- package/dist/modules/manager/jsonnet-bundler/artifacts.js +4 -22
- package/dist/modules/manager/jsonnet-bundler/artifacts.js.map +1 -1
- package/dist/modules/manager/kustomize/artifacts.js +9 -23
- package/dist/modules/manager/kustomize/artifacts.js.map +1 -1
- package/dist/modules/manager/mise/artifacts.js +13 -22
- package/dist/modules/manager/mise/artifacts.js.map +1 -1
- package/dist/modules/manager/mix/artifacts.js +5 -18
- package/dist/modules/manager/mix/artifacts.js.map +1 -1
- package/dist/modules/manager/nuget/artifacts.js +3 -10
- package/dist/modules/manager/nuget/artifacts.js.map +1 -1
- package/dist/modules/manager/pep621/processors/pdm.js +7 -15
- package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
- package/dist/modules/manager/pep621/processors/uv.js +7 -15
- package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
- package/dist/modules/manager/pixi/lockfile.js +25 -28
- package/dist/modules/manager/pixi/lockfile.js.map +1 -1
- package/dist/modules/manager/poetry/artifacts.js +41 -46
- package/dist/modules/manager/poetry/artifacts.js.map +1 -1
- package/dist/modules/manager/pub/artifacts.js +13 -16
- package/dist/modules/manager/pub/artifacts.js.map +1 -1
- package/dist/modules/manager/renovate-config/extract.js +3 -1
- package/dist/modules/manager/renovate-config/extract.js.map +1 -1
- package/dist/modules/manager/terragrunt/modules.js +2 -0
- package/dist/modules/manager/terragrunt/modules.js.map +1 -1
- package/dist/modules/manager/types.d.ts +19 -1
- package/dist/modules/manager/util.js +60 -1
- package/dist/modules/manager/util.js.map +1 -1
- package/dist/modules/manager/vendir/artifacts.js +7 -31
- package/dist/modules/manager/vendir/artifacts.js.map +1 -1
- package/dist/modules/platform/gitea/index.js +7 -4
- package/dist/modules/platform/gitea/index.js.map +1 -1
- package/dist/modules/platform/gitea/utils.js +2 -2
- package/dist/modules/platform/gitea/utils.js.map +1 -1
- package/dist/modules/versioning/composer/index.js +1 -1
- package/dist/modules/versioning/composer/index.js.map +1 -1
- package/dist/modules/versioning/docker/index.js +1 -1
- package/dist/modules/versioning/docker/index.js.map +1 -1
- package/dist/modules/versioning/gradle/compare.js +4 -4
- package/dist/modules/versioning/gradle/compare.js.map +1 -1
- package/dist/modules/versioning/hermit/index.js +1 -2
- package/dist/modules/versioning/hermit/index.js.map +1 -1
- package/dist/modules/versioning/ivy/index.js +2 -5
- package/dist/modules/versioning/ivy/index.js.map +1 -1
- package/dist/modules/versioning/ivy/parse.js +4 -7
- package/dist/modules/versioning/ivy/parse.js.map +1 -1
- package/dist/modules/versioning/maven/compare.js +7 -10
- package/dist/modules/versioning/maven/compare.js.map +1 -1
- package/dist/modules/versioning/nuget/parser.js +2 -3
- package/dist/modules/versioning/nuget/parser.js.map +1 -1
- package/dist/modules/versioning/nuget/range.js +1 -1
- package/dist/modules/versioning/nuget/range.js.map +1 -1
- package/dist/modules/versioning/pep440/range.js +6 -21
- package/dist/modules/versioning/pep440/range.js.map +1 -1
- package/dist/modules/versioning/rpm/index.js +1 -2
- package/dist/modules/versioning/rpm/index.js.map +1 -1
- package/dist/util/git/file-changes.js +50 -0
- package/dist/util/git/file-changes.js.map +1 -0
- package/dist/util/template/index.js +1 -0
- package/dist/util/template/index.js.map +1 -1
- package/dist/workers/global/config/parse/additional-config-file.js +1 -1
- package/dist/workers/global/config/parse/additional-config-file.js.map +1 -1
- package/dist/workers/global/limits.js +0 -1
- package/dist/workers/global/limits.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/index.js +4 -2
- package/dist/workers/repository/onboarding/branch/index.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/rebase.js +2 -1
- package/dist/workers/repository/onboarding/branch/rebase.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/forgejo/index.js +1 -3
- package/dist/workers/repository/update/pr/changelog/forgejo/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/gitea/index.js +1 -3
- package/dist/workers/repository/update/pr/changelog/gitea/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/gitlab/index.js +1 -3
- package/dist/workers/repository/update/pr/changelog/gitlab/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/source.js +6 -1
- package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
- package/package.json +1 -1
- package/renovate-schema.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"known-actions.js","names":["nodeVersioning.id","gradleVersioning.id","condaVersioning.id"],"sources":["../../../../lib/modules/manager/github-actions/known-actions.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\nimport { regEx } from '../../../util/regex.ts';\nimport { CrateDatasource } from '../../datasource/crate/index.ts';\nimport { DartVersionDatasource } from '../../datasource/dart-version/index.ts';\nimport { DockerDatasource } from '../../datasource/docker/index.ts';\nimport { DotnetVersionDatasource } from '../../datasource/dotnet-version/index.ts';\nimport { GithubReleaseAttachmentsDatasource } from '../../datasource/github-release-attachments/index.ts';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';\nimport { GradleVersionDatasource } from '../../datasource/gradle-version/index.ts';\nimport { JavaVersionDatasource } from '../../datasource/java-version/index.ts';\nimport { NodeVersionDatasource } from '../../datasource/node-version/index.ts';\nimport { NpmDatasource } from '../../datasource/npm/index.ts';\nimport { PypiDatasource } from '../../datasource/pypi/index.ts';\nimport { RubyVersionDatasource } from '../../datasource/ruby-version/index.ts';\nimport { RustVersionDatasource } from '../../datasource/rust-version/index.ts';\nimport * as condaVersioning from '../../versioning/conda/index.ts';\nimport * as gradleVersioning from '../../versioning/gradle/index.ts';\nimport * as nodeVersioning from '../../versioning/node/index.ts';\nimport * as npmVersioning from '../../versioning/npm/index.ts';\nimport { splitImageParts } from '../dockerfile/extract.ts';\nimport type { PackageDependency } from '../types.ts';\nimport type { ActionSchema, KnownActionConfig } from './types.ts';\n\nexport function actionSchema(\n name: string,\n { withSchema, ...cfg }: KnownActionConfig,\n): ActionSchema {\n return z\n .object({\n uses: matchAction(name),\n with: withSchema ?? VersionVal,\n })\n .transform(({ with: deps }) =>\n deps.map((dep) => {\n const merged = { ...cfg, ...dep };\n merged.depName ??= merged.packageName;\n return merged;\n }),\n );\n}\n\nfunction matchAction(action: string): z.ZodString {\n return z\n .string()\n .regex(regEx(`(?:https?://[^/]+/)?${RegExp.escape(action)}(?:@.+)?$`));\n}\n\nfunction parseValue(\n currentValue: string | undefined,\n isInvalid?: (val: string) => boolean,\n): PackageDependency {\n if (!currentValue) {\n return {\n skipStage: 'extract',\n skipReason: 'unspecified-version',\n depType: 'uses-with',\n };\n }\n if (isInvalid?.(currentValue) === true) {\n return {\n skipStage: 'extract',\n skipReason: 'invalid-version',\n depType: 'uses-with',\n currentValue,\n };\n }\n return { currentValue, depType: 'uses-with' };\n}\n\n/**\n * A single dependency, versioned by the given `with:` input.\n *\n * @param isInvalid should return `true` if the version is invalid and should be skipped\n */\nfunction valSchema(\n key: string,\n isInvalid?: (val: string) => boolean,\n): ActionSchema {\n return z\n .object({ [key]: z.string().optional() })\n .transform((val) => [parseValue(val[key], isInvalid)]);\n}\n\nconst VersionVal = valSchema('version');\n\n/**\n * `gradle/actions/setup-gradle` has a few `gradle-version`s that are strings used to denote another source than a specific version number, which shouldn't have an update proposed for.\n */\nconst GradleVersionAliases = new Set([\n 'wrapper',\n 'current',\n 'release-candidate',\n 'nightly',\n 'release-nightly',\n]);\n\n// Shared by the `actions/setup-{go,node,python}` entries below, whose\n// releases are published as `actions/{go,node,python}-versions` GitHub\n// releases, tagged like `20.11.0` or `20.11.0-1` (a build number suffix).\nconst actionsVersionsExtractVersion =\n '^(?<version>\\\\d+\\\\.\\\\d+\\\\.\\\\d+)(-\\\\d+)?$';\n\n// `actions-rust-lang/setup-rust-toolchain`'s `toolchain` input is a\n// comma-separated list of toolchains; only the LAST one becomes the active\n// default toolchain, so that's the only one worth tracking.\nconst SetupRustToolchainWith: ActionSchema = z\n .object({ toolchain: z.string().optional() })\n .transform(({ toolchain }) => [\n parseValue(toolchain?.split(',').pop()?.trim()),\n ]);\n\nconst InstallBinaryWith: ActionSchema = z\n .object({ repo: z.string(), tag: z.string() })\n .transform(({ repo, tag }) => [{ packageName: repo, ...parseValue(tag) }]);\n\n// Same shape as `InstallBinaryWith` above, but the package name comes from\n// a crates.io crate name rather than a GitHub repo. `version` has a default\n// (`'latest'`), so real workflows commonly omit it from `with:` entirely.\nconst CargoInstallWith: ActionSchema = z\n .object({ crate: z.string(), version: z.string().optional() })\n .transform(({ crate, version }) => [\n { packageName: crate, ...parseValue(version) },\n ]);\n\nfunction parseImageValue(image: string | undefined): PackageDependency {\n if (!image) {\n return {\n depType: 'uses-with',\n skipStage: 'extract',\n skipReason: 'unspecified-version',\n };\n }\n\n const dep = splitImageParts(image);\n return {\n depType: 'uses-with',\n ...dep,\n ...(dep.skipReason ? { skipStage: 'extract' } : {}),\n };\n}\n\nconst EcsRenderTaskDefinitionWith: ActionSchema = z\n .object({ image: z.string().optional() })\n .transform(({ image }) => [parseImageValue(image)]);\n\nconst sha256Regex = regEx(/^[a-f0-9]{64}$/);\nconst MiseWith: ActionSchema = z\n .object({\n version: z.string().optional(),\n sha256: z.string().optional(),\n })\n .transform(({ version, sha256 }) => [\n {\n ...parseValue(version),\n ...(sha256 && sha256Regex.test(sha256) ? { currentDigest: sha256 } : {}),\n },\n ]);\n\n// Runtimes installable by `pnpm/setup`, keyed by the name used in its\n// `runtime:` input. `bun` and `deno` reuse the datasources of their respective\n// `setup-*` actions below.\nconst pnpmRuntimes: Record<string, PackageDependency | undefined> = {\n node: { datasource: NodeVersionDatasource.id, packageName: 'node' },\n bun: { datasource: NpmDatasource.id, packageName: 'bun' },\n deno: { datasource: NpmDatasource.id, packageName: 'deno' },\n};\n\nfunction parsePnpmRuntime(runtime: string | undefined): PackageDependency[] {\n if (!runtime) {\n return [];\n }\n\n // `<name>` or `<name>@<version>`, matching pnpm's `packageManager` field syntax\n const [name, version] = runtime.split('@');\n const cfg = pnpmRuntimes[name];\n if (!cfg) {\n return [\n {\n packageName: name || runtime,\n depType: 'uses-with',\n skipStage: 'extract',\n skipReason: 'invalid-name',\n },\n ];\n }\n\n return [{ ...cfg, ...parseValue(version) }];\n}\n\nconst PnpmSetupWith: ActionSchema = z\n .object({\n version: z.string().optional(),\n runtime: z.string().optional(),\n })\n .transform(({ version, runtime }) => [\n parseValue(version),\n ...parsePnpmRuntime(runtime),\n ]);\n\n// Distributions whose version numbering we can reliably track via the\n// java-version datasource (which sources releases from Adoptium/Eclipse\n// Temurin). Other distributions may not follow the same release cadence\n// or versioning, so we don't attempt to track them.\nconst supportedJavaDistributions = new Set(['temurin', 'adopt']);\n\nconst SetupJavaWith: ActionSchema = z\n .object({\n distribution: z.string().optional(),\n 'java-version': z.string().optional(),\n 'java-package': z.string().optional(),\n })\n .transform(\n ({\n distribution,\n 'java-version': version,\n 'java-package': javaPackage,\n }) => {\n const packageName = javaPackage?.startsWith('jre')\n ? 'java-jre'\n : 'java-jdk';\n\n if (\n !distribution ||\n !supportedJavaDistributions.has(distribution.toLowerCase())\n ) {\n return [\n {\n packageName,\n depType: 'uses-with',\n skipStage: 'extract',\n skipReason: 'unsupported',\n },\n ];\n }\n\n return [{ packageName, ...parseValue(version) }];\n },\n );\n\n// `'latest'` is a valid, documented value for `tflint_version` (it's also the\n// action's own default), but it isn't a version we can pin/bump, so treat it\n// as present-but-unsupported rather than as an invalid value.\nconst TflintWith: ActionSchema = z\n .object({ tflint_version: z.string().optional() })\n .transform(({ tflint_version: version }) => {\n if (version === 'latest') {\n return [\n {\n currentValue: version,\n depType: 'uses-with',\n skipStage: 'extract',\n skipReason: 'unsupported-version',\n },\n ];\n }\n return [parseValue(version)];\n });\n\n// `helm/kind-action` can yield up to 3 dependencies from a single step: the\n// `kind` binary itself, the `kindest/node` image it boots, and (optionally) a\n// pinned `kubectl` binary. All 3 inputs are optional, so only emit a\n// dependency for the ones a workflow actually sets.\nconst KindActionWith: ActionSchema = z\n .object({\n version: z.string().optional(),\n node_image: z.string().optional(),\n kubectl_version: z.string().optional(),\n })\n .transform(({ version, node_image, kubectl_version }) => {\n const deps: PackageDependency[] = [];\n\n if (version) {\n deps.push({\n packageName: 'kubernetes-sigs/kind',\n ...parseValue(version),\n });\n }\n\n if (node_image) {\n // `node_image` may be pinned by digest (e.g.\n // `kindest/node:v1.31.0@sha256:...`), so reuse the same Docker\n // image-reference parsing as `aws-actions/amazon-ecs-render-task-definition`\n // rather than naively splitting on `:`.\n deps.push({\n datasource: DockerDatasource.id,\n ...parseImageValue(node_image),\n });\n }\n\n if (kubectl_version) {\n deps.push({\n packageName: 'kubernetes/kubernetes',\n ...parseValue(kubectl_version),\n });\n }\n\n return deps;\n });\n\n// `erlef/setup-beam` can yield up to 4 dependencies from a single step: OTP,\n// Elixir, Gleam, and rebar3. All inputs are optional, so only emit a\n// dependency for the ones a workflow actually sets.\nconst ErlefSetupBeamWith: ActionSchema = z\n .object({\n 'otp-version': z.string().optional(),\n 'elixir-version': z.string().optional(),\n 'gleam-version': z.string().optional(),\n 'rebar3-version': z.string().optional(),\n })\n .transform(\n ({\n 'otp-version': otpVersion,\n 'elixir-version': elixirVersion,\n 'gleam-version': gleamVersion,\n 'rebar3-version': rebar3Version,\n }) => {\n const deps: PackageDependency[] = [];\n\n if (otpVersion) {\n deps.push({\n packageName: 'erlang/otp',\n // erlang/otp tags releases like `OTP-27.1.2`\n extractVersion: '^OTP-(?<version>.+)$',\n ...parseValue(otpVersion),\n });\n }\n\n if (elixirVersion) {\n deps.push({\n packageName: 'elixir-lang/elixir',\n ...parseValue(elixirVersion),\n });\n }\n\n if (gleamVersion) {\n deps.push({\n packageName: 'gleam-lang/gleam',\n ...parseValue(gleamVersion),\n });\n }\n\n if (rebar3Version) {\n deps.push({\n packageName: 'erlang/rebar3',\n ...parseValue(rebar3Version),\n });\n }\n\n return deps;\n },\n );\n\n// `graalvm/setup-graalvm` can yield up to 2 dependencies from a single step:\n// the JDK version it's built on, and the GraalVM distribution version\n// itself. Both inputs are optional, so only emit a dependency for the ones\n// a workflow actually sets.\n//\n// `graalvm/graalvm-ce-builds` has used several tag-naming conventions over\n// its history (`vm-ce-`, `vm-`, `jdk-`, `graal-`), and still alternates\n// between `jdk-` and `graal-` prefixes for releases after GraalVM's 2023\n// unification with JDK versioning, so we match both of those current-era\n// prefixes rather than either one alone.\nconst GraalvmSetupWith: ActionSchema = z\n .object({\n 'java-version': z.string().optional(),\n version: z.string().optional(),\n })\n .transform(({ 'java-version': javaVersion, version }) => {\n const deps: PackageDependency[] = [];\n\n if (javaVersion) {\n deps.push({\n datasource: JavaVersionDatasource.id,\n packageName: 'java-jdk',\n ...parseValue(javaVersion),\n });\n }\n\n if (version) {\n deps.push({\n datasource: GithubReleasesDatasource.id,\n packageName: 'graalvm/graalvm-ce-builds',\n extractVersion: '^(?:jdk|graal)-(?<version>.+)$',\n ...parseValue(version),\n });\n }\n\n return deps;\n });\n\n// `moonrepo/setup-toolchain` can yield up to 2 dependencies from a single\n// step: the `moon` binary and the `proto` binary. Both inputs are optional,\n// so only emit a dependency for the ones a workflow actually sets.\nconst MoonrepoSetupToolchainWith: ActionSchema = z\n .object({\n 'moon-version': z.string().optional(),\n 'proto-version': z.string().optional(),\n })\n .transform(\n ({ 'moon-version': moonVersion, 'proto-version': protoVersion }) => {\n const deps: PackageDependency[] = [];\n\n if (moonVersion) {\n deps.push({\n packageName: 'moonrepo/moon',\n ...parseValue(moonVersion),\n });\n }\n\n if (protoVersion) {\n deps.push({\n packageName: 'moonrepo/proto',\n ...parseValue(protoVersion),\n });\n }\n\n return deps;\n },\n );\n\n// `crystal-lang/install-crystal` can yield up to 2 dependencies from a\n// single step: the Crystal compiler itself, and the shards package manager.\n// Both inputs are optional, so only emit a dependency for the ones a\n// workflow actually sets.\nconst InstallCrystalWith: ActionSchema = z\n .object({\n crystal: z.string().optional(),\n shards: z.string().optional(),\n })\n .transform(({ crystal, shards }) => {\n const deps: PackageDependency[] = [];\n\n if (crystal) {\n deps.push({\n packageName: 'crystal-lang/crystal',\n ...parseValue(crystal),\n });\n }\n\n if (shards) {\n deps.push({\n packageName: 'crystal-lang/shards',\n ...parseValue(shards),\n });\n }\n\n return deps;\n });\n\n// `conda-incubator/setup-miniconda` exposes 6 separate version inputs\n// (`miniconda-version`, `miniforge-version`, `conda-version`,\n// `conda-build-version`, `python-version`, `mamba-version`), but only 2 map\n// onto a datasource we can reliably use: `miniforge-version` (GitHub\n// releases of `conda-forge/miniforge`) and `python-version` (the same\n// `actions/python-versions` releases already used for `actions/setup-python`).\n// The other 4 are versioned via anaconda.org channels or an installer\n// archive with no clean Renovate datasource, so they're intentionally not\n// tracked. Both supported inputs are optional, so only emit a dependency\n// for the ones a workflow actually sets.\nconst SetupMinicondaWith: ActionSchema = z\n .object({\n 'miniforge-version': z.string().optional(),\n 'python-version': z.string().optional(),\n })\n .transform(\n ({\n 'miniforge-version': miniforgeVersion,\n 'python-version': pythonVersion,\n }) => {\n const deps: PackageDependency[] = [];\n\n if (miniforgeVersion) {\n deps.push({\n datasource: GithubReleasesDatasource.id,\n depName: 'miniforge',\n packageName: 'conda-forge/miniforge',\n ...parseValue(miniforgeVersion),\n });\n }\n\n if (pythonVersion) {\n deps.push({\n datasource: GithubReleasesDatasource.id,\n depName: 'python',\n packageName: 'actions/python-versions',\n versioning: npmVersioning.id,\n extractVersion: actionsVersionsExtractVersion,\n ...parseValue(pythonVersion),\n });\n }\n\n return deps;\n },\n );\n\nconst renovateGithubActionDefaultImage = 'ghcr.io/renovatebot/renovate';\nconst RenovateGithubActionWith: ActionSchema = z\n .object({\n 'renovate-version': z.string().optional(),\n 'renovate-image': z.string().optional(),\n })\n .transform(({ 'renovate-version': version, 'renovate-image': image }) => {\n const [packageName, currentDigest] = (\n image ?? renovateGithubActionDefaultImage\n ).split('@');\n return [\n {\n packageName,\n ...(currentDigest ? { currentDigest } : {}),\n ...parseValue(version),\n },\n ];\n });\n\n/**\n * Community-maintained and first-party (GitHub's own `actions/*`) Actions\n * with known version input schemas.\n */\nexport const knownActions: Record<string, KnownActionConfig> = {\n // https://github.com/abatilo/actions-poetry\n 'abatilo/actions-poetry': {\n datasource: PypiDatasource.id,\n packageName: 'poetry',\n withSchema: valSchema('poetry-version'),\n },\n // https://github.com/actions-rust-lang/setup-rust-toolchain\n 'actions-rust-lang/setup-rust-toolchain': {\n datasource: RustVersionDatasource.id,\n packageName: 'rust',\n withSchema: SetupRustToolchainWith,\n },\n // https://github.com/actions/setup-dotnet\n 'actions/setup-dotnet': {\n datasource: DotnetVersionDatasource.id,\n packageName: 'dotnet-sdk',\n withSchema: valSchema('dotnet-version', (val) => val.includes('\\n')),\n },\n // https://github.com/actions/setup-go\n 'actions/setup-go': {\n datasource: GithubReleasesDatasource.id,\n depName: 'go',\n packageName: 'actions/go-versions',\n versioning: npmVersioning.id,\n extractVersion: actionsVersionsExtractVersion,\n withSchema: valSchema('go-version'),\n },\n // https://github.com/actions/setup-java\n 'actions/setup-java': {\n datasource: JavaVersionDatasource.id,\n packageName: '', // determined from `distribution`/`java-package` inputs\n withSchema: SetupJavaWith,\n },\n // https://github.com/actions/setup-node\n 'actions/setup-node': {\n datasource: GithubReleasesDatasource.id,\n depName: 'node',\n packageName: 'actions/node-versions',\n versioning: nodeVersioning.id,\n extractVersion: actionsVersionsExtractVersion,\n withSchema: valSchema('node-version'),\n },\n // https://github.com/actions/setup-python\n 'actions/setup-python': {\n datasource: GithubReleasesDatasource.id,\n depName: 'python',\n packageName: 'actions/python-versions',\n versioning: npmVersioning.id,\n extractVersion: actionsVersionsExtractVersion,\n withSchema: valSchema('python-version'),\n },\n // https://github.com/aquaproj/aqua-installer\n 'aquaproj/aqua-installer': {\n datasource: GithubReleasesDatasource.id,\n depName: 'aqua',\n packageName: 'aquaproj/aqua',\n withSchema: valSchema('aqua_version'),\n },\n // https://github.com/aquasecurity/setup-trivy\n 'aquasecurity/setup-trivy': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'aquasecurity/trivy',\n },\n // https://github.com/aquasecurity/trivy-action\n 'aquasecurity/trivy-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'aquasecurity/trivy',\n },\n // https://github.com/astral-sh/ruff-action\n 'astral-sh/ruff-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'ruff',\n packageName: 'astral-sh/ruff',\n },\n // https://github.com/astral-sh/setup-uv\n 'astral-sh/setup-uv': {\n datasource: GithubReleasesDatasource.id,\n versioning: npmVersioning.id,\n packageName: 'astral-sh/uv',\n },\n // https://github.com/aws-actions/amazon-ecs-render-task-definition\n 'aws-actions/amazon-ecs-render-task-definition': {\n datasource: DockerDatasource.id,\n packageName: '', // determined from `image` input\n withSchema: EcsRenderTaskDefinitionWith,\n },\n 'azure/setup-helm': {\n datasource: GithubReleasesDatasource.id,\n depName: 'helm',\n packageName: 'helm/helm',\n },\n // https://github.com/azure/setup-kubectl\n 'azure/setup-kubectl': {\n datasource: GithubReleasesDatasource.id,\n depName: 'kubectl',\n packageName: 'kubernetes/kubernetes',\n },\n // https://github.com/baptiste0928/cargo-install\n 'baptiste0928/cargo-install': {\n datasource: CrateDatasource.id,\n packageName: '', // determined from the `crate` input\n withSchema: CargoInstallWith,\n },\n // https://github.com/biomejs/setup-biome\n 'biomejs/setup-biome': {\n datasource: NpmDatasource.id,\n packageName: '@biomejs/biome',\n },\n // https://github.com/bufbuild/buf-setup-action\n 'bufbuild/buf-setup-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'buf',\n packageName: 'bufbuild/buf',\n },\n // https://github.com/cargo-bins/cargo-binstall\n 'cargo-bins/cargo-binstall': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'cargo-bins/cargo-binstall',\n // the repo also publishes releases for its internal sub-crates (e.g.\n // `detect-targets-v0.1.91`, `binstalk-v0.28.81`) — only match the bare\n // main-tool release tag\n extractVersion: '^v(?<version>\\\\d+\\\\.\\\\d+\\\\.\\\\d+)$',\n },\n // https://github.com/cloudflare/wrangler-action\n 'cloudflare/wrangler-action': {\n datasource: NpmDatasource.id,\n packageName: 'wrangler',\n withSchema: valSchema('wranglerVersion'),\n },\n // https://github.com/conda-incubator/setup-miniconda\n 'conda-incubator/setup-miniconda': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined per dependency: miniforge-version, python-version\n withSchema: SetupMinicondaWith,\n },\n // https://github.com/crystal-lang/install-crystal\n 'crystal-lang/install-crystal': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined per dependency: crystal, shards\n withSchema: InstallCrystalWith,\n },\n // https://github.com/cue-lang/setup-cue\n 'cue-lang/setup-cue': {\n datasource: GithubReleasesDatasource.id,\n depName: 'cue',\n packageName: 'cue-lang/cue',\n },\n // https://github.com/cycjimmy/semantic-release-action\n 'cycjimmy/semantic-release-action': {\n datasource: NpmDatasource.id,\n packageName: 'semantic-release',\n // the action's docs describe `semantic_version` as a version range, not\n // a pinned exact version\n versioning: npmVersioning.id,\n withSchema: valSchema('semantic_version'),\n },\n // https://github.com/dagger/dagger-for-github\n 'dagger/dagger-for-github': {\n datasource: GithubReleasesDatasource.id,\n depName: 'dagger',\n packageName: 'dagger/dagger',\n // the repo also publishes per-SDK/component tags sharing the same\n // version (e.g. `sdk/typescript/v0.21.9`, `helm/chart/v0.21.9`) — only\n // match the bare release tag\n extractVersion: '^v(?<version>\\\\d+\\\\..*)$',\n },\n // https://github.com/dart-lang/setup-dart\n 'dart-lang/setup-dart': {\n datasource: DartVersionDatasource.id,\n depName: 'dart',\n packageName: 'dart-lang/sdk',\n withSchema: valSchema('sdk'),\n },\n // https://github.com/azure/setup-helm\n 'denoland/setup-deno': {\n datasource: NpmDatasource.id,\n packageName: 'deno',\n withSchema: valSchema('deno-version'),\n },\n // https://github.com/docker/setup-buildx-action\n 'docker/setup-buildx-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'buildx',\n packageName: 'docker/buildx',\n },\n // https://github.com/docker/setup-compose-action\n 'docker/setup-compose-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'docker/compose',\n },\n // https://github.com/docker/setup-docker-action\n 'docker/setup-docker-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'docker',\n packageName: 'moby/moby',\n extractVersion: '^docker-(?<version>.+)$',\n },\n // https://github.com/dtolnay/rust-toolchain\n 'dtolnay/rust-toolchain': {\n datasource: RustVersionDatasource.id,\n packageName: 'rust',\n withSchema: valSchema('toolchain'),\n },\n // https://github.com/erlef/setup-beam\n 'erlef/setup-beam': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined per dependency: OTP, Elixir, Gleam, rebar3\n withSchema: ErlefSetupBeamWith,\n },\n // https://github.com/expo/expo-github-action\n 'expo/expo-github-action': {\n datasource: NpmDatasource.id,\n packageName: 'eas-cli',\n withSchema: valSchema('eas-version'),\n },\n // https://github.com/extractions/setup-just\n 'extractions/setup-just': {\n datasource: GithubReleasesDatasource.id,\n depName: 'just',\n packageName: 'casey/just',\n withSchema: valSchema('just-version'),\n },\n // https://github.com/foundry-rs/foundry-toolchain\n 'foundry-rs/foundry-toolchain': {\n datasource: GithubReleasesDatasource.id,\n depName: 'foundry',\n packageName: 'foundry-rs/foundry',\n },\n // https://github.com/GitTools/actions (there is no root-level Action, only\n // subpaths are usable; the sibling `GitTools/actions/gitreleasemanager/setup`\n // is a separate, unrelated Action)\n 'GitTools/actions/gitversion/setup': {\n datasource: GithubReleasesDatasource.id,\n depName: 'gitversion',\n packageName: 'GitTools/GitVersion',\n withSchema: valSchema('versionSpec'),\n },\n 'golangci/golangci-lint-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'golangci/golangci-lint',\n },\n // https://github.com/goreleaser/goreleaser-action\n 'goreleaser/goreleaser-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'goreleaser/goreleaser',\n // the default value (`~> v2`) is itself a range, not a pinned version\n versioning: npmVersioning.id,\n },\n // https://github.com/graalvm/setup-graalvm\n 'graalvm/setup-graalvm': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined per dependency: java-version, version\n withSchema: GraalvmSetupWith,\n },\n // https://github.com/gradle/actions (there is no root-level Action, only\n // subpaths such as `setup-gradle` are usable)\n 'gradle/actions/setup-gradle': {\n datasource: GradleVersionDatasource.id,\n depName: 'gradle',\n packageName: 'gradle/gradle',\n versioning: gradleVersioning.id,\n withSchema: valSchema('gradle-version', (val) =>\n GradleVersionAliases.has(val),\n ),\n },\n // https://github.com/hashicorp/setup-packer\n 'hashicorp/setup-packer': {\n datasource: GithubReleasesDatasource.id,\n depName: 'packer',\n packageName: 'hashicorp/packer',\n },\n // https://github.com/hashicorp/setup-terraform\n 'hashicorp/setup-terraform': {\n datasource: GithubReleasesDatasource.id,\n depName: 'terraform',\n packageName: 'hashicorp/terraform',\n withSchema: valSchema('terraform_version'),\n },\n // https://github.com/helm/chart-releaser-action\n 'helm/chart-releaser-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'chart-releaser',\n packageName: 'helm/chart-releaser',\n },\n // https://github.com/helm/chart-testing-action\n 'helm/chart-testing-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'chart-testing',\n packageName: 'helm/chart-testing',\n },\n // https://github.com/helm/kind-action\n 'helm/kind-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined per dependency: `version`, `node_image`, `kubectl_version`\n withSchema: KindActionWith,\n },\n // https://github.com/j178/prek-action\n 'j178/prek-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'prek',\n packageName: 'j178/prek',\n // the value may be a semver range (e.g. `0.3.x`, `<=1.0.0`), not just a\n // pinned version\n versioning: npmVersioning.id,\n withSchema: valSchema('prek-version'),\n },\n 'jakebailey/pyright-action': {\n datasource: NpmDatasource.id,\n packageName: 'pyright',\n withSchema: valSchema('version', (val) => val === 'PATH'),\n },\n 'jaxxstorm/action-install-gh-release': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined from `repo` input\n withSchema: InstallBinaryWith,\n },\n 'jdx/mise-action': {\n datasource: GithubReleaseAttachmentsDatasource.id,\n packageName: 'jdx/mise',\n withSchema: MiseWith,\n },\n // https://github.com/jfrog/setup-jfrog-cli\n 'jfrog/setup-jfrog-cli': {\n datasource: GithubReleasesDatasource.id,\n depName: 'jfrog-cli',\n packageName: 'jfrog/jfrog-cli',\n },\n // https://github.com/julia-actions/setup-julia\n 'julia-actions/setup-julia': {\n datasource: GithubReleasesDatasource.id,\n depName: 'julia',\n packageName: 'JuliaLang/julia',\n },\n // https://github.com/jwlawson/actions-setup-cmake\n 'jwlawson/actions-setup-cmake': {\n datasource: GithubReleasesDatasource.id,\n depName: 'cmake',\n packageName: 'Kitware/CMake',\n withSchema: valSchema('cmake-version'),\n },\n // https://github.com/moonrepo/setup-rust\n 'moonrepo/setup-rust': {\n datasource: RustVersionDatasource.id,\n packageName: 'rust',\n withSchema: valSchema('channel'),\n },\n // https://github.com/moonrepo/setup-toolchain\n 'moonrepo/setup-toolchain': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined per dependency: moon-version, proto-version\n withSchema: MoonrepoSetupToolchainWith,\n },\n // https://github.com/mozilla-actions/sccache-action\n 'mozilla-actions/sccache-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'sccache',\n packageName: 'mozilla/sccache',\n },\n // https://github.com/opentofu/setup-opentofu\n 'opentofu/setup-opentofu': {\n datasource: GithubReleasesDatasource.id,\n depName: 'opentofu',\n packageName: 'opentofu/opentofu',\n withSchema: valSchema('tofu_version'),\n },\n 'oven-sh/setup-bun': {\n datasource: NpmDatasource.id,\n packageName: 'bun',\n withSchema: valSchema('bun-version'),\n },\n 'pdm-project/setup-pdm': {\n datasource: PypiDatasource.id,\n packageName: 'pdm',\n },\n // https://github.com/peaceiris/actions-hugo\n 'peaceiris/actions-hugo': {\n datasource: GithubReleasesDatasource.id,\n depName: 'hugo',\n packageName: 'gohugoio/hugo',\n withSchema: valSchema('hugo-version'),\n },\n 'pnpm/action-setup': {\n datasource: NpmDatasource.id,\n packageName: 'pnpm',\n },\n 'pnpm/setup': {\n datasource: NpmDatasource.id,\n packageName: 'pnpm',\n withSchema: PnpmSetupWith,\n },\n 'prefix-dev/setup-pixi': {\n datasource: GithubReleasesDatasource.id,\n versioning: condaVersioning.id,\n packageName: 'prefix-dev/pixi',\n withSchema: valSchema('pixi-version'),\n },\n // https://github.com/pulumi/actions\n 'pulumi/actions': {\n datasource: GithubReleasesDatasource.id,\n depName: 'pulumi',\n packageName: 'pulumi/pulumi',\n withSchema: valSchema('pulumi-version'),\n },\n // https://github.com/PyO3/maturin-action\n 'PyO3/maturin-action': {\n datasource: PypiDatasource.id,\n packageName: 'maturin',\n withSchema: valSchema('maturin-version'),\n },\n // https://github.com/pypa/hatch/tree/install\n 'pypa/hatch': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'pypa/hatch',\n // Strip hatch- prefix from release tags\n extractVersion: '^hatch-(?<version>.+)$',\n },\n // https://github.com/raven-actions/actionlint\n 'raven-actions/actionlint': {\n datasource: GithubReleasesDatasource.id,\n depName: 'actionlint',\n packageName: 'rhysd/actionlint',\n },\n // https://github.com/renovatebot/github-action\n 'renovatebot/github-action': {\n datasource: DockerDatasource.id,\n packageName: '', // determined from `renovate-image` input, if set\n withSchema: RenovateGithubActionWith,\n },\n // https://github.com/reviewdog/action-setup\n 'reviewdog/action-setup': {\n datasource: GithubReleasesDatasource.id,\n depName: 'reviewdog',\n packageName: 'reviewdog/reviewdog',\n withSchema: valSchema('reviewdog_version'),\n },\n 'ruby/setup-ruby': {\n datasource: RubyVersionDatasource.id,\n packageName: 'ruby',\n withSchema: valSchema('ruby-version'),\n },\n 'sigoden/install-binary': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined from `repo` input\n withSchema: InstallBinaryWith,\n },\n 'sigstore/cosign-installer': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'sigstore/cosign',\n withSchema: valSchema('cosign-release'),\n },\n // https://github.com/snok/install-poetry\n 'snok/install-poetry': {\n datasource: PypiDatasource.id,\n packageName: 'poetry',\n },\n // https://github.com/stCarolas/setup-maven\n 'stCarolas/setup-maven': {\n datasource: GithubReleasesDatasource.id,\n depName: 'maven',\n packageName: 'apache/maven',\n // apache/maven tags its releases as `maven-X.Y.Z`\n extractVersion: '^maven-(?<version>.+)$',\n // the input also documents range/glob specs (e.g. `10.x`, `>=10.15.0`),\n // not just pinned versions\n versioning: npmVersioning.id,\n withSchema: valSchema('maven-version'),\n },\n // https://github.com/subosito/flutter-action\n 'subosito/flutter-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'flutter',\n packageName: 'flutter/flutter',\n withSchema: valSchema('flutter-version'),\n },\n // https://github.com/supabase/setup-cli\n 'supabase/setup-cli': {\n datasource: NpmDatasource.id,\n packageName: 'supabase',\n },\n // https://github.com/superfly/flyctl-actions (there is no root-level\n // Action for this purpose — the repo root has an unrelated action.yml, and\n // the real usable Action lives at the `setup-flyctl` subpath)\n 'superfly/flyctl-actions/setup-flyctl': {\n datasource: GithubReleasesDatasource.id,\n depName: 'flyctl',\n packageName: 'superfly/flyctl',\n },\n // https://github.com/swift-actions/setup-swift\n 'swift-actions/setup-swift': {\n datasource: GithubReleasesDatasource.id,\n depName: 'swift',\n packageName: 'swiftlang/swift',\n // swiftlang/swift tags releases like `swift-6.3.3-RELEASE`\n extractVersion: '^swift-(?<version>.+)-RELEASE$',\n withSchema: valSchema('swift-version'),\n },\n // https://github.com/terraform-linters/setup-tflint\n 'terraform-linters/setup-tflint': {\n datasource: GithubReleasesDatasource.id,\n depName: 'tflint',\n packageName: 'terraform-linters/tflint',\n withSchema: TflintWith,\n },\n 'UpCloudLtd/upcloud-cli-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'UpCloudLtd/upcloud-cli',\n },\n // https://github.com/WillAbides/setup-go-faster\n 'WillAbides/setup-go-faster': {\n datasource: GithubReleasesDatasource.id,\n depName: 'go',\n packageName: 'actions/go-versions',\n versioning: npmVersioning.id,\n extractVersion: actionsVersionsExtractVersion,\n withSchema: valSchema('go-version'),\n },\n 'zizmorcore/zizmor-action': {\n datasource: DockerDatasource.id,\n packageName: 'ghcr.io/zizmorcore/zizmor',\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,aACd,MACA,EAAE,YAAY,GAAG,OACH;CACd,OAAO,EACJ,OAAO;EACN,MAAM,YAAY,IAAI;EACtB,MAAM,cAAc;CACtB,CAAC,CAAC,CACD,WAAW,EAAE,MAAM,WAClB,KAAK,KAAK,QAAQ;EAChB,MAAM,SAAS;GAAE,GAAG;G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a;CACf;CAEA,6BAA6B;EAC3B,YAAY,yBAAyB;EACrC,SAAS;EACT,aAAa;EAEb,gBAAgB;EAChB,YAAY,UAAU,eAAe;CACvC;CAEA,kCAAkC;EAChC,YAAY,yBAAyB;EACrC,SAAS;EACT,aAAa;EACb,YAAY;CACd;CACA,iCAAiC;EAC/B,YAAY,yBAAyB;EACrC,aAAa;CACf;CAEA,8BAA8B;EAC5B,YAAY,yBAAyB;EACrC,SAAS;EACT,aAAa;EACb,YAAY;EACZ,gBAAgB;EAChB,YAAY,UAAU,YAAY;CACpC;CACA,4BAA4B;EAC1B,YAAY,iBAAiB;EAC7B,aAAa;CACf;AACF"}
|
|
1
|
+
{"version":3,"file":"known-actions.js","names":[],"sources":["../../../../lib/modules/manager/github-actions/known-actions.ts"],"sourcesContent":["import { crateDynamicActions } from './known-actions/crate-dynamic.ts';\nimport { dartVersionActions } from './known-actions/dart-version.ts';\nimport { dockerActions } from './known-actions/docker.ts';\nimport { dockerDynamicActions } from './known-actions/docker-dynamic.ts';\nimport { dotnetVersionActions } from './known-actions/dotnet-version.ts';\nimport { githubReleaseAttachmentsDynamicActions } from './known-actions/github-release-attachments-dynamic.ts';\nimport { githubReleasesActions } from './known-actions/github-releases.ts';\nimport { githubReleasesDynamicActions } from './known-actions/github-releases-dynamic.ts';\nimport { gradleVersionActions } from './known-actions/gradle-version.ts';\nimport { javaVersionDynamicActions } from './known-actions/java-version-dynamic.ts';\nimport { multipleActions } from './known-actions/multiple.ts';\nimport { npmActions } from './known-actions/npm.ts';\nimport { pypiActions } from './known-actions/pypi.ts';\nimport { rubyVersionActions } from './known-actions/ruby-version.ts';\nimport { rustVersionActions } from './known-actions/rust-version.ts';\nimport { rustVersionDynamicActions } from './known-actions/rust-version-dynamic.ts';\nimport type { KnownActionConfig } from './types.ts';\n\nexport { actionSchema } from './known-actions/utils.ts';\n\n/**\n * Community-maintained and first-party (GitHub's own `actions/*`) Actions\n * with known version input schemas.\n */\nexport const knownActions: Record<string, KnownActionConfig> = {\n ...dockerActions,\n ...dockerDynamicActions,\n ...dartVersionActions,\n ...dotnetVersionActions,\n ...githubReleasesActions,\n ...githubReleasesDynamicActions,\n ...githubReleaseAttachmentsDynamicActions,\n ...gradleVersionActions,\n ...javaVersionDynamicActions,\n ...npmActions,\n ...pypiActions,\n ...rubyVersionActions,\n ...rustVersionActions,\n ...rustVersionDynamicActions,\n ...crateDynamicActions,\n ...multipleActions,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,eAAkD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LooseArray, LooseRecord, Yaml, withDebugMessage } from "../../../util/schema-utils/index.js";
|
|
2
|
-
import { actionSchema
|
|
2
|
+
import { actionSchema } from "./known-actions/utils.js";
|
|
3
|
+
import { knownActions } from "./known-actions.js";
|
|
3
4
|
import { z } from "zod/v4";
|
|
4
5
|
//#region lib/modules/manager/github-actions/schema.ts
|
|
5
6
|
const UsesStep = z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/manager/github-actions/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport {\n LooseArray,\n LooseRecord,\n Yaml,\n withDebugMessage,\n} from '../../../util/schema-utils/index.ts';\nimport { actionSchema, knownActions } from './known-actions.ts';\nimport type { ActionSchema } from './types.ts';\n\nconst UsesStep = z.object({\n uses: z.string(),\n with: LooseRecord(\n z.union([z.string(), z.number().transform((s) => s.toString())]),\n ),\n});\nexport type UsesStep = z.infer<typeof UsesStep>;\n\n// A `parallel:` group flattens its (recursively resolved) sub-steps into leaf steps.\n// See: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-running-steps-in-parallel\nconst ParallelStep: z.ZodType<UsesStep[]> = z\n .object({ parallel: LooseArray(z.lazy(() => Step)) })\n .transform(({ parallel }) => parallel.flat());\n\n// A step resolves to a flat list of `uses:` steps: a normal step yields itself,\n// a `parallel:` group yields its flattened sub-steps.\nconst Step: z.ZodType<UsesStep[]> = z.union([\n UsesStep.transform((step) => [step]),\n ParallelStep,\n]);\n\n// Flatten the per-element `UsesStep[]` groups into a single `UsesStep[]`.\nconst Steps = LooseArray(Step).transform((groups) => groups.flat());\n\nconst WorkFlowJobs = z.object({\n jobs: LooseRecord(\n z.object({\n container: z\n .union([\n z.string(),\n z.object({ image: z.string() }).transform((v) => v.image),\n ])\n .optional()\n .catch(undefined),\n services: LooseRecord(\n z.union([\n z.object({ image: z.string() }).transform((v) => v.image),\n z.string(),\n ]),\n )\n .catch({})\n .transform((services) => Object.values(services)),\n 'runs-on': z\n .union([z.string().transform((v) => [v]), z.array(z.string())])\n .catch([]),\n steps: Steps.catch([]),\n }),\n ),\n});\n\nconst Actions = z.object({\n runs: z.object({\n using: z.string(),\n steps: Steps.optional().catch([]),\n }),\n});\nexport const Workflow = Yaml.pipe(\n z.union([WorkFlowJobs, Actions, z.null()]),\n).catch(withDebugMessage(null, 'Does not match schema'));\n\n/**\n * The `actions.lock` schema is owned by the `gh actions-lock` CLI, and is still unstable, so don't rely on the structure too heavily.\n *\n * `workflows` is deliberately required: if the tool renames or reshapes it, we want the parse to fail so that we stop touching the lockfile, rather than silently treating every workflow as un-onboarded.\n *\n * TODO #45191: pin to a version of the schema, once it is v1\n */\nexport const ActionsLockfile = Yaml.pipe(\n z.object({\n workflows: z.record(z.string(), z.unknown()),\n }),\n);\nexport type ActionsLockfile = z.infer<typeof ActionsLockfile>;\n\nexport const CommunityActions = z.union(\n Object.entries(knownActions).map(([name, cfg]) =>\n actionSchema(name, cfg),\n ) as [ActionSchema, ActionSchema, ...ActionSchema[]],\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/manager/github-actions/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport {\n LooseArray,\n LooseRecord,\n Yaml,\n withDebugMessage,\n} from '../../../util/schema-utils/index.ts';\nimport { actionSchema, knownActions } from './known-actions.ts';\nimport type { ActionSchema } from './types.ts';\n\nconst UsesStep = z.object({\n uses: z.string(),\n with: LooseRecord(\n z.union([z.string(), z.number().transform((s) => s.toString())]),\n ),\n});\nexport type UsesStep = z.infer<typeof UsesStep>;\n\n// A `parallel:` group flattens its (recursively resolved) sub-steps into leaf steps.\n// See: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-running-steps-in-parallel\nconst ParallelStep: z.ZodType<UsesStep[]> = z\n .object({ parallel: LooseArray(z.lazy(() => Step)) })\n .transform(({ parallel }) => parallel.flat());\n\n// A step resolves to a flat list of `uses:` steps: a normal step yields itself,\n// a `parallel:` group yields its flattened sub-steps.\nconst Step: z.ZodType<UsesStep[]> = z.union([\n UsesStep.transform((step) => [step]),\n ParallelStep,\n]);\n\n// Flatten the per-element `UsesStep[]` groups into a single `UsesStep[]`.\nconst Steps = LooseArray(Step).transform((groups) => groups.flat());\n\nconst WorkFlowJobs = z.object({\n jobs: LooseRecord(\n z.object({\n container: z\n .union([\n z.string(),\n z.object({ image: z.string() }).transform((v) => v.image),\n ])\n .optional()\n .catch(undefined),\n services: LooseRecord(\n z.union([\n z.object({ image: z.string() }).transform((v) => v.image),\n z.string(),\n ]),\n )\n .catch({})\n .transform((services) => Object.values(services)),\n 'runs-on': z\n .union([z.string().transform((v) => [v]), z.array(z.string())])\n .catch([]),\n steps: Steps.catch([]),\n }),\n ),\n});\n\nconst Actions = z.object({\n runs: z.object({\n using: z.string(),\n steps: Steps.optional().catch([]),\n }),\n});\nexport const Workflow = Yaml.pipe(\n z.union([WorkFlowJobs, Actions, z.null()]),\n).catch(withDebugMessage(null, 'Does not match schema'));\n\n/**\n * The `actions.lock` schema is owned by the `gh actions-lock` CLI, and is still unstable, so don't rely on the structure too heavily.\n *\n * `workflows` is deliberately required: if the tool renames or reshapes it, we want the parse to fail so that we stop touching the lockfile, rather than silently treating every workflow as un-onboarded.\n *\n * TODO #45191: pin to a version of the schema, once it is v1\n */\nexport const ActionsLockfile = Yaml.pipe(\n z.object({\n workflows: z.record(z.string(), z.unknown()),\n }),\n);\nexport type ActionsLockfile = z.infer<typeof ActionsLockfile>;\n\nexport const CommunityActions = z.union(\n Object.entries(knownActions).map(([name, cfg]) =>\n actionSchema(name, cfg),\n ) as [ActionSchema, ActionSchema, ...ActionSchema[]],\n);\n"],"mappings":";;;;;AAUA,MAAM,WAAW,EAAE,OAAO;CACxB,MAAM,EAAE,OAAO;CACf,MAAM,YACJ,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,WAAW,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACjE;AACF,CAAC;AAKD,MAAM,eAAsC,EACzC,OAAO,EAAE,UAAU,WAAW,EAAE,WAAW,IAAI,CAAC,EAAE,CAAC,CAAC,CACpD,WAAW,EAAE,eAAe,SAAS,KAAK,CAAC;AAI9C,MAAM,OAA8B,EAAE,MAAM,CAC1C,SAAS,WAAW,SAAS,CAAC,IAAI,CAAC,GACnC,YACF,CAAC;AAGD,MAAM,QAAQ,WAAW,IAAI,CAAC,CAAC,WAAW,WAAW,OAAO,KAAK,CAAC;AAElE,MAAM,eAAe,EAAE,OAAO,EAC5B,MAAM,YACJ,EAAE,OAAO;CACP,WAAW,EACR,MAAM,CACL,EAAE,OAAO,GACT,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,MAAM,EAAE,KAAK,CAC1D,CAAC,CAAC,CACD,SAAS,CAAC,CACV,MAAM,KAAA,CAAS;CAClB,UAAU,YACR,EAAE,MAAM,CACN,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,MAAM,EAAE,KAAK,GACxD,EAAE,OAAO,CACX,CAAC,CACH,CAAC,CACE,MAAM,CAAC,CAAC,CAAC,CACT,WAAW,aAAa,OAAO,OAAO,QAAQ,CAAC;CAClD,WAAW,EACR,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAC9D,MAAM,CAAC,CAAC;CACX,OAAO,MAAM,MAAM,CAAC,CAAC;AACvB,CAAC,CACH,EACF,CAAC;AAED,MAAM,UAAU,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO;CACb,OAAO,EAAE,OAAO;CAChB,OAAO,MAAM,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC,EACH,CAAC;AACD,MAAa,WAAW,KAAK,KAC3B,EAAE,MAAM;CAAC;CAAc;CAAS,EAAE,KAAK;AAAC,CAAC,CAC3C,CAAC,CAAC,MAAM,iBAAiB,MAAM,uBAAuB,CAAC;;;;;;;;AASvD,MAAa,kBAAkB,KAAK,KAClC,EAAE,OAAO,EACP,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAC7C,CAAC,CACH;AAGA,MAAa,mBAAmB,EAAE,MAChC,OAAO,QAAQ,YAAY,CAAC,CAAC,KAAK,CAAC,MAAM,SACvC,aAAa,MAAM,GAAG,CACxB,CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region lib/modules/manager/github-actions/types.ts
|
|
2
|
+
/**
|
|
3
|
+
* Where a Datasource defined on the `KnownActionConfig` isn't actually used.
|
|
4
|
+
*/
|
|
5
|
+
const DATASOURCE_DETERMINED_DYNAMICALLY = "unused";
|
|
6
|
+
//#endregion
|
|
7
|
+
export { DATASOURCE_DETERMINED_DYNAMICALLY };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../lib/modules/manager/github-actions/types.ts"],"sourcesContent":["import type { z } from 'zod/v4';\nimport type { FileChange } from '../../../util/git/types.ts';\nimport type { ArtifactError, PackageDependency } from '../types.ts';\nimport type { ActionsLockfile } from './schema.ts';\n\n/** Mirrors the shape `processBranch` already concatenates onto its config for lock file updates. */\nexport interface ActionsLockfileResult {\n updatedArtifacts: FileChange[];\n artifactErrors: ArtifactError[];\n}\n\n/** The workflows which `gh actions-lock` has onboarded, keyed by their path. */\nexport type OnboardedWorkflows = ActionsLockfile['workflows'];\n\n/** The repository's `actions.lock`, as far as we can make sense of it. */\nexport type LockfileState =\n | { type: 'missing' }\n | { type: 'unparseable' }\n | { type: 'parsed'; onboardedWorkflows: OnboardedWorkflows };\n\n/**\n * Docker container:\n * - `docker://image:tag`\n * - `docker://image@digest`\n * - `docker://image:tag@digest`\n */\nexport interface DockerReference {\n kind: 'docker';\n image: string;\n tag?: string;\n digest?: string;\n originalRef: string;\n}\n\n/**\n * Local file or directory:\n * - `./path/to/action`\n * - `./.github/workflows/main.yml`\n */\nexport interface LocalReference {\n kind: 'local';\n path: string;\n}\n\n/**\n * Repository:\n * - `owner/repo[/path]@ref`\n * - `https://host/owner/repo[/path]@ref`\n */\nexport interface RepositoryReference {\n kind: 'repository';\n\n hostname: string;\n isExplicitHostname: boolean;\n\n owner: string;\n repo: string;\n path?: string;\n\n ref: string;\n}\n\nexport type ActionReference =\n DockerReference | LocalReference | RepositoryReference;\n\nexport interface CommentData {\n pinnedVersion?: string;\n ref?: string;\n ratchetExclude?: boolean;\n matchedString?: string;\n index?: number;\n}\n\nexport interface ParsedUsesLine {\n /** The whitespace before \"uses:\" */\n indentation: string;\n\n /** The `uses:` (and optional `-`) part */\n usesPrefix: string;\n\n /** The raw value part, potentially quoted (e.g. `actions/checkout@v2`) */\n replaceString: string;\n\n /** Whitespace between value and `#` */\n commentPrecedingWhitespace: string;\n\n /** The full comment including `#` */\n commentString: string;\n\n actionRef: ActionReference | null;\n commentData: CommentData;\n\n /** The quote char used (' or \" or empty) */\n quote: string;\n}\n\n/**\n * Parses a step - or just its `with:` block - into the dependencies it\n * declares. Most actions declare a single one, but a step may yield several.\n */\nexport type ActionSchema = z.ZodType<PackageDependency[]>;\n\n/**\n * Where a Datasource defined on the `KnownActionConfig` isn't actually used.\n */\nexport const DATASOURCE_DETERMINED_DYNAMICALLY = 'unused';\n\nexport interface KnownActionConfig {\n datasource: string;\n depName?: string;\n packageName: string;\n versioning?: string;\n extractVersion?: string;\n\n /**\n * Parses the `with:` block, defaulting to the `version:` input.\n *\n * The fields above are applied to every dependency it yields, so a schema\n * which yields dependencies of more than one kind must set them itself.\n */\n withSchema?: ActionSchema;\n}\n"],"mappings":";;;;AAyGA,MAAa,oCAAoC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../../../constants/error-messages.js";
|
|
2
2
|
import { logger } from "../../../logger/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getSiblingFileName, readLocalFile } from "../../../util/fs/index.js";
|
|
4
4
|
import { exec } from "../../../util/exec/index.js";
|
|
5
|
-
import { resolveToolConstraint } from "../util.js";
|
|
5
|
+
import { artifactErrorResult, resolveToolConstraint, updateLockFile } from "../util.js";
|
|
6
6
|
import { isEmptyArray, isString } from "@sindresorhus/is";
|
|
7
7
|
import { quote } from "shlex";
|
|
8
8
|
//#region lib/modules/manager/gleam/artifacts.ts
|
|
@@ -21,8 +21,6 @@ async function updateArtifacts(updateArtifact) {
|
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
try {
|
|
24
|
-
await writeLocalFile(packageFileName, newPackageFileContent);
|
|
25
|
-
if (isLockFileMaintenance) await deleteLocalFile(lockFileName);
|
|
26
24
|
const execOptions = {
|
|
27
25
|
cwdFile: packageFileName,
|
|
28
26
|
docker: {},
|
|
@@ -32,31 +30,23 @@ async function updateArtifacts(updateArtifact) {
|
|
|
32
30
|
}]
|
|
33
31
|
};
|
|
34
32
|
const updateCommand = ["gleam deps update", ...(isLockFileMaintenance ? [] : updatedDeps.map((dep) => dep.depName).filter(isString)).map(quote)].join(" ");
|
|
35
|
-
await
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
return [{ file: {
|
|
46
|
-
type: "addition",
|
|
47
|
-
path: lockFileName,
|
|
48
|
-
contents: newLockFileContent
|
|
49
|
-
} }];
|
|
33
|
+
return await updateLockFile({
|
|
34
|
+
lockFileName,
|
|
35
|
+
existingLockFileContent: oldLockFileContent,
|
|
36
|
+
packageFile: {
|
|
37
|
+
path: packageFileName,
|
|
38
|
+
contents: newPackageFileContent
|
|
39
|
+
},
|
|
40
|
+
deleteLockFile: isLockFileMaintenance,
|
|
41
|
+
run: () => exec(updateCommand, execOptions)
|
|
42
|
+
});
|
|
50
43
|
} catch (err) {
|
|
51
44
|
if (err.message === "temporary-error") throw err;
|
|
52
45
|
logger.warn({
|
|
53
46
|
lockfile: lockFileName,
|
|
54
47
|
err
|
|
55
48
|
}, `Failed to update lock file`);
|
|
56
|
-
return
|
|
57
|
-
fileName: lockFileName,
|
|
58
|
-
stderr: err.message
|
|
59
|
-
} }];
|
|
49
|
+
return artifactErrorResult(lockFileName, err);
|
|
60
50
|
}
|
|
61
51
|
}
|
|
62
52
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.js","names":[],"sources":["../../../../lib/modules/manager/gleam/artifacts.ts"],"sourcesContent":["import { isEmptyArray, isString } from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { exec } from '../../../util/exec/index.ts';\nimport type { ExecOptions } from '../../../util/exec/types.ts';\nimport {
|
|
1
|
+
{"version":3,"file":"artifacts.js","names":[],"sources":["../../../../lib/modules/manager/gleam/artifacts.ts"],"sourcesContent":["import { isEmptyArray, isString } from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { exec } from '../../../util/exec/index.ts';\nimport type { ExecOptions } from '../../../util/exec/types.ts';\nimport { getSiblingFileName, readLocalFile } from '../../../util/fs/index.ts';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types.ts';\nimport {\n artifactErrorResult,\n resolveToolConstraint,\n updateLockFile,\n} from '../util.ts';\n\nexport async function updateArtifacts(\n updateArtifact: UpdateArtifact,\n): Promise<UpdateArtifactsResult[] | null> {\n const { packageFileName, updatedDeps, newPackageFileContent, config } =\n updateArtifact;\n logger.debug(`gleam.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (isEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated gleam deps - returning null');\n return null;\n }\n\n const lockFileName = getSiblingFileName(packageFileName, 'manifest.toml');\n\n const oldLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!oldLockFileContent) {\n logger.debug(`No ${lockFileName} found`);\n return null;\n }\n\n try {\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n docker: {},\n toolConstraints: [\n {\n toolName: 'gleam',\n constraint: await resolveToolConstraint(config, 'gleam'),\n },\n ],\n };\n\n // `gleam deps update` with no packages rebuilds the lock file\n const packagesToUpdate = isLockFileMaintenance\n ? []\n : updatedDeps.map((dep) => dep.depName).filter(isString);\n\n const updateCommand = [\n 'gleam deps update',\n ...packagesToUpdate.map(quote),\n ].join(' ');\n return await updateLockFile({\n lockFileName,\n existingLockFileContent: oldLockFileContent,\n packageFile: { path: packageFileName, contents: newPackageFileContent },\n deleteLockFile: isLockFileMaintenance,\n run: () => exec(updateCommand, execOptions),\n });\n } catch (err) {\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.warn({ lockfile: lockFileName, err }, `Failed to update lock file`);\n return artifactErrorResult(lockFileName, err);\n }\n}\n"],"mappings":";;;;;;;;AAcA,eAAsB,gBACpB,gBACyC;CACzC,MAAM,EAAE,iBAAiB,aAAa,uBAAuB,WAC3D;CACF,OAAO,MAAM,yBAAyB,gBAAgB,EAAE;CACxD,MAAM,EAAE,0BAA0B;CAElC,IAAI,aAAa,WAAW,KAAK,CAAC,uBAAuB;EACvD,OAAO,MAAM,wCAAwC;EACrD,OAAO;CACT;CAEA,MAAM,eAAe,mBAAmB,iBAAiB,eAAe;CAExE,MAAM,qBAAqB,MAAM,cAAc,cAAc,MAAM;CACnE,IAAI,CAAC,oBAAoB;EACvB,OAAO,MAAM,MAAM,aAAa,OAAO;EACvC,OAAO;CACT;CAEA,IAAI;EACF,MAAM,cAA2B;GAC/B,SAAS;GACT,QAAQ,CAAC;GACT,iBAAiB,CACf;IACE,UAAU;IACV,YAAY,MAAM,sBAAsB,QAAQ,OAAO;GACzD,CACF;EACF;EAOA,MAAM,gBAAgB,CACpB,qBACA,IANuB,wBACrB,CAAC,IACD,YAAY,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,OAAO,QAAQ,EAAA,CAInC,IAAI,KAAK,CAC/B,CAAC,CAAC,KAAK,GAAG;EACV,OAAO,MAAM,eAAe;GAC1B;GACA,yBAAyB;GACzB,aAAa;IAAE,MAAM;IAAiB,UAAU;GAAsB;GACtE,gBAAgB;GAChB,WAAW,KAAK,eAAe,WAAW;EAC5C,CAAC;CACH,SAAS,KAAK;EACZ,IAAI,IAAI,YAAA,mBACN,MAAM;EAER,OAAO,KAAK;GAAE,UAAU;GAAc;EAAI,GAAG,4BAA4B;EACzE,OAAO,oBAAoB,cAAc,GAAG;CAC9C;AACF"}
|
|
@@ -2,13 +2,13 @@ import "../../../constants/error-messages.js";
|
|
|
2
2
|
import { getEnv } from "../../../util/env.js";
|
|
3
3
|
import { regEx } from "../../../util/regex.js";
|
|
4
4
|
import { GlobalConfig } from "../../../config/global.js";
|
|
5
|
-
import { coerceArray } from "../../../util/array.js";
|
|
6
5
|
import { logger } from "../../../logger/index.js";
|
|
7
6
|
import { ensureCacheDir, findLocalSiblingOrParent, isValidLocalPath, readLocalFile, writeLocalFile } from "../../../util/fs/index.js";
|
|
8
7
|
import { filterMap } from "../../../util/filter-map.js";
|
|
9
8
|
import { isValid as isVersion } from "../../versioning/semver/index.js";
|
|
10
9
|
import { getRepoStatus } from "../../../util/git/index.js";
|
|
11
|
-
import {
|
|
10
|
+
import { collectFileChanges } from "../../../util/git/file-changes.js";
|
|
11
|
+
import { artifactErrorResult, fileAddition, fileChangesToArtifactResults, resolveToolConstraint } from "../util.js";
|
|
12
12
|
import { withGitEnvironment } from "../../../util/git/exec.js";
|
|
13
13
|
import { getExtraDepsNotice } from "./artifacts-extra.js";
|
|
14
14
|
import { getGoModulesInTidyOrder } from "./package-tree.js";
|
|
@@ -191,54 +191,27 @@ async function updateArtifacts({ packageFileName: goModFileName, updatedDeps, ne
|
|
|
191
191
|
const res = [];
|
|
192
192
|
if (status.modified.includes(sumFileName)) {
|
|
193
193
|
logger.debug("Returning updated go.sum");
|
|
194
|
-
res.push(
|
|
195
|
-
type: "addition",
|
|
196
|
-
path: sumFileName,
|
|
197
|
-
contents: await readLocalFile(sumFileName)
|
|
198
|
-
} });
|
|
194
|
+
res.push(fileAddition(sumFileName, await readLocalFile(sumFileName)));
|
|
199
195
|
}
|
|
200
196
|
if (status.modified.includes(goWorkSumFileName)) {
|
|
201
197
|
logger.debug("Returning updated go.work.sum");
|
|
202
|
-
res.push(
|
|
203
|
-
type: "addition",
|
|
204
|
-
path: goWorkSumFileName,
|
|
205
|
-
contents: await readLocalFile(goWorkSumFileName)
|
|
206
|
-
} });
|
|
198
|
+
res.push(fileAddition(goWorkSumFileName, await readLocalFile(goWorkSumFileName)));
|
|
207
199
|
}
|
|
208
200
|
for (const f of dependentFiles) if (status.modified.includes(f)) {
|
|
209
201
|
logger.trace(`Returning updated ${f}`);
|
|
210
|
-
res.push(
|
|
211
|
-
type: "addition",
|
|
212
|
-
path: f,
|
|
213
|
-
contents: await readLocalFile(f)
|
|
214
|
-
} });
|
|
202
|
+
res.push(fileAddition(f, await readLocalFile(f)));
|
|
215
203
|
}
|
|
216
204
|
if (isImportPathUpdateRequired) {
|
|
217
205
|
logger.debug("Returning updated go source files for import path changes");
|
|
218
|
-
for (const f of status.modified) if (f.endsWith(".go")) res.push(
|
|
219
|
-
type: "addition",
|
|
220
|
-
path: f,
|
|
221
|
-
contents: await readLocalFile(f)
|
|
222
|
-
} });
|
|
206
|
+
for (const f of status.modified) if (f.endsWith(".go")) res.push(fileAddition(f, await readLocalFile(f)));
|
|
223
207
|
}
|
|
224
208
|
const alreadyAdded = /* @__PURE__ */ new Set();
|
|
225
209
|
const alreadyDeleted = /* @__PURE__ */ new Set();
|
|
226
210
|
if (useVendor) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
path: f,
|
|
232
|
-
contents: await readLocalFile(f)
|
|
233
|
-
} });
|
|
234
|
-
}
|
|
235
|
-
for (const f of coerceArray(status.deleted)) if (vendorDir && f.startsWith(vendorDir)) {
|
|
236
|
-
alreadyDeleted.add(f);
|
|
237
|
-
res.push({ file: {
|
|
238
|
-
type: "deletion",
|
|
239
|
-
path: f
|
|
240
|
-
} });
|
|
241
|
-
}
|
|
211
|
+
const vendorChanges = await collectFileChanges(status, { filter: (f) => !!vendorDir && f.startsWith(vendorDir) });
|
|
212
|
+
for (const change of vendorChanges) if (change.type === "addition") alreadyAdded.add(change.path);
|
|
213
|
+
else alreadyDeleted.add(change.path);
|
|
214
|
+
res.push(...fileChangesToArtifactResults(vendorChanges));
|
|
242
215
|
}
|
|
243
216
|
const finalGoModContent = (await readLocalFile(goModFileName, "utf8")).replace(regEx(/\/\/ renovate-replace /g), "").replace(regEx(/renovate-replace-bracket/g), ")");
|
|
244
217
|
if (finalGoModContent !== newGoModContent) {
|
|
@@ -259,24 +232,19 @@ async function updateArtifacts({ packageFileName: goModFileName, updatedDeps, ne
|
|
|
259
232
|
}
|
|
260
233
|
if (useGoGenerate && goGenerateAllowed) {
|
|
261
234
|
logger.debug("Updating all modified files since generated files were added");
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
path: f
|
|
270
|
-
} });
|
|
235
|
+
res.push(...fileChangesToArtifactResults([...await collectFileChanges(status, {
|
|
236
|
+
include: ["modified", "created"],
|
|
237
|
+
filter: (f) => !alreadyAdded.has(f)
|
|
238
|
+
}), ...await collectFileChanges(status, {
|
|
239
|
+
include: ["deleted"],
|
|
240
|
+
filter: (f) => !alreadyDeleted.has(f)
|
|
241
|
+
})]));
|
|
271
242
|
}
|
|
272
243
|
return res;
|
|
273
244
|
} catch (err) {
|
|
274
245
|
if (err.message === "temporary-error") throw err;
|
|
275
246
|
logger.debug({ err }, "Failed to update go.sum");
|
|
276
|
-
return
|
|
277
|
-
fileName: sumFileName,
|
|
278
|
-
stderr: err.message
|
|
279
|
-
} }];
|
|
247
|
+
return artifactErrorResult(sumFileName, err);
|
|
280
248
|
}
|
|
281
249
|
}
|
|
282
250
|
function getGoConstraints(content) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.js","names":["valid","major","isValid"],"sources":["../../../../lib/modules/manager/gomod/artifacts.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport semver from 'semver';\nimport { quote } from 'shlex';\nimport upath from 'upath';\nimport { GlobalConfig } from '../../../config/global.ts';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport { getEnv } from '../../../util/env.ts';\nimport type { ExecOptions } from '../../../util/exec/types.ts';\nimport { filterMap } from '../../../util/filter-map.ts';\nimport {\n ensureCacheDir,\n findLocalSiblingOrParent,\n isValidLocalPath,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs/index.ts';\nimport { withGitEnvironment } from '../../../util/git/exec.ts';\nimport { getRepoStatus } from '../../../util/git/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { isValid } from '../../versioning/semver/index.ts';\nimport type {\n PackageDependency,\n UpdateArtifact,\n UpdateArtifactsConfig,\n UpdateArtifactsResult,\n} from '../types.ts';\nimport { resolveToolConstraint } from '../util.ts';\nimport { getExtraDepsNotice } from './artifacts-extra.ts';\nimport { getGoModulesInTidyOrder } from './package-tree.ts';\n\nconst { major, valid } = semver;\nconst gitExec = withGitEnvironment(['go']);\n\nasync function getUpdateImportPathCmds(\n updatedDeps: PackageDependency[],\n config: UpdateArtifactsConfig,\n): Promise<string[]> {\n // Check if we fail to parse any major versions and log that they're skipped\n const invalidMajorDeps = updatedDeps.filter(\n ({ newVersion }) => !valid(newVersion),\n );\n if (invalidMajorDeps.length > 0) {\n invalidMajorDeps.forEach(({ depName }) =>\n logger.warn(\n { depName },\n 'Ignoring dependency: Could not get major version',\n ),\n );\n }\n\n const updateImportCommands = updatedDeps\n .filter(\n ({ newVersion }) =>\n valid(newVersion) && !newVersion!.endsWith('+incompatible'),\n )\n .map(({ depName, newVersion }) => ({\n depName: depName!,\n newMajor: major(newVersion!),\n }))\n // Skip path updates going from v0 to v1\n .filter(\n ({ depName, newMajor }) =>\n depName.startsWith('gopkg.in/') || newMajor > 1,\n )\n\n .map(\n ({ depName, newMajor }) =>\n `mod upgrade --mod-name=${quote(depName)} -t=${newMajor}`,\n );\n\n if (updateImportCommands.length > 0) {\n let installMarwanModArgs =\n 'install github.com/marwan-at-work/mod/cmd/mod@latest';\n const gomodModCompatibility = await resolveToolConstraint(\n config,\n 'gomodMod',\n );\n if (gomodModCompatibility) {\n if (\n gomodModCompatibility.startsWith('v') &&\n isValid(gomodModCompatibility.replace(regEx(/^v/), ''))\n ) {\n installMarwanModArgs = installMarwanModArgs.replace(\n regEx(/@latest$/),\n `@${gomodModCompatibility}`,\n );\n } else {\n logger.debug(\n { gomodModCompatibility },\n 'marwan-at-work/mod compatibility range is not valid - skipping',\n );\n }\n } else {\n logger.debug(\n 'No marwan-at-work/mod compatibility range found - installing marwan-at-work/mod latest',\n );\n }\n updateImportCommands.unshift(`go ${installMarwanModArgs}`);\n }\n\n return updateImportCommands;\n}\n\nfunction useModcacherw(goVersion: string | undefined): boolean {\n if (!isString(goVersion)) {\n return true;\n }\n\n return semver.intersects(goVersion, `>=1.14`);\n}\n\nexport async function updateArtifacts({\n packageFileName: goModFileName,\n updatedDeps,\n newPackageFileContent: newGoModContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`gomod.updateArtifacts(${goModFileName})`);\n\n const sumFileName = goModFileName.replace(regEx(/\\.mod$/), '.sum');\n const existingGoSumContent = await readLocalFile(sumFileName);\n if (!existingGoSumContent) {\n logger.debug('No go.sum found');\n return null;\n }\n const goModDir = upath.dirname(goModFileName);\n const goModFileBaseName = upath.basename(goModFileName);\n const modFileFlag =\n goModFileBaseName === 'go.mod'\n ? ''\n : ` -modfile=${quote(goModFileBaseName)}`;\n\n // The \"vendor\" directory can be next to the go.mod, but also in the parent directory in case\n // the go workspaces are used.\n const vendorDir = await findLocalSiblingOrParent(goModFileName, 'vendor');\n const vendorModulesFileName = upath.join(vendorDir ?? '', 'modules.txt');\n const useVendor =\n !!config.postUpdateOptions?.includes('gomodVendor') ||\n (!config.postUpdateOptions?.includes('gomodSkipVendor') &&\n vendorDir &&\n (await readLocalFile(vendorModulesFileName)) !== null);\n let massagedGoMod = newGoModContent;\n const useGoGenerate = !!config.postUpdateOptions?.includes('goGenerate');\n const allowedUnsafeExecutions = GlobalConfig.get('allowedUnsafeExecutions');\n const goGenerateAllowed = allowedUnsafeExecutions?.includes('goGenerate');\n\n if (config.postUpdateOptions?.includes('gomodMassage')) {\n // Regex match inline replace directive, example:\n // replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\n // https://go.dev/ref/mod#go-mod-file-replace\n\n // replace bracket after comments, so it doesn't break the regex, doing a complex regex causes problems\n // when there's a comment and \")\" after it, the regex will read replace block until comment.. and stop.\n massagedGoMod = massagedGoMod\n .split('\\n')\n .map((line) => {\n if (line.trim().startsWith('//')) {\n return line.replace(')', 'renovate-replace-bracket');\n }\n return line;\n })\n .join('\\n');\n\n const inlineReplaceRegEx = regEx(\n /(?<newline>\\r?\\n)(?<directive>replace\\s+[^\\s]+\\s+=>\\s+\\.\\.\\/.*)/g,\n );\n\n // $<newline> will be matched with the (\\r?\\n) group\n // $<directive> will be matched with the inline replace match, example\n // \"// renovate-replace replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\"\n const inlineCommentOut = '$<newline>// renovate-replace $<directive>';\n\n // Regex match replace directive block, example:\n // replace (\n // golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\n // )\n const blockReplaceRegEx = regEx(/(?:\\r?\\n)replace\\s*\\([^)]+\\s*\\)/g);\n\n /**\n * replacerFunction for commenting out replace blocks\n * @param match A string representing a golang replace directive block\n * @returns A commented out block with // renovate-replace\n */\n function blockCommentOut(match: string): string {\n return match.replace(\n regEx(/(?<newline>\\r?\\n)/g),\n '$<newline>// renovate-replace ',\n );\n }\n\n // Comment out golang replace directives\n massagedGoMod = massagedGoMod\n .replace(inlineReplaceRegEx, inlineCommentOut)\n .replace(blockReplaceRegEx, blockCommentOut);\n\n // v8 ignore else -- needs a go.mod the replace massaging leaves unchanged\n if (massagedGoMod !== newGoModContent) {\n logger.debug(\n 'Removed some relative replace statements and comments from go.mod',\n );\n }\n }\n const goConstraints = await deriveGoToolchainConstraints(\n config,\n newGoModContent,\n );\n\n try {\n await writeLocalFile(goModFileName, massagedGoMod);\n\n const cmd = 'go';\n const env = getEnv();\n const execOptions: ExecOptions = {\n cwdFile: goModFileName,\n extraEnv: {\n GOPATH: await ensureCacheDir('go'),\n GOPROXY: env.GOPROXY,\n GOPRIVATE: env.GOPRIVATE,\n GONOPROXY: env.GONOPROXY,\n GONOSUMDB: env.GONOSUMDB,\n GOSUMDB: env.GOSUMDB,\n GOINSECURE: env.GOINSECURE,\n /* v8 ignore next -- TODO: add test */\n GOFLAGS: useModcacherw(goConstraints) ? '-modcacherw' : null,\n CGO_ENABLED: GlobalConfig.get('binarySource') === 'docker' ? '0' : null,\n },\n docker: {},\n toolConstraints: [\n {\n toolName: 'golang',\n constraint: goConstraints,\n },\n ],\n };\n\n const execCommands: string[] = [];\n\n let goGetDirs: string | undefined;\n if (config.goGetDirs) {\n goGetDirs = config.goGetDirs\n .filter((dir) => {\n const isValid = isValidLocalPath(dir);\n if (!isValid) {\n logger.warn({ dir }, 'Invalid path in goGetDirs');\n }\n return isValid;\n })\n .map(quote)\n .join(' ');\n\n if (goGetDirs === '') {\n throw new Error('Invalid goGetDirs');\n }\n }\n\n let args = `get${modFileFlag} `;\n\n if (goConstraints && !semver.intersects(goConstraints, `>=1.18`)) {\n // For Go versions < 1.18, we need to use the -d flag to avoid builds or installs\n // https://go.dev/doc/go1.18#go-get\n args += `-d `;\n }\n\n args += `-t ${goGetDirs ?? './...'}`;\n logger.trace({ cmd, args }, 'go get command included');\n execCommands.push(`${cmd} ${args}`);\n\n // Update import paths on major updates\n const isImportPathUpdateRequired =\n config.postUpdateOptions?.includes('gomodUpdateImportPaths') &&\n config.updateType === 'major';\n\n if (isImportPathUpdateRequired) {\n const updateImportCmds = await getUpdateImportPathCmds(\n updatedDeps,\n config,\n );\n if (updateImportCmds.length > 0) {\n logger.debug(updateImportCmds, 'update import path commands included');\n // The updates\n execCommands.push(...updateImportCmds);\n }\n }\n\n const mustSkipGoModTidy =\n !config.postUpdateOptions?.includes('gomodUpdateImportPaths') &&\n config.updateType === 'major';\n if (mustSkipGoModTidy) {\n logger.debug('go mod tidy command skipped');\n }\n\n let tidyOpts = '';\n if (config.postUpdateOptions?.includes('gomodTidy1.17')) {\n tidyOpts += ' -compat=1.17';\n }\n if (config.postUpdateOptions?.includes('gomodTidyE')) {\n tidyOpts += ' -e';\n }\n\n // dependent modules can only be tidied once the updated module is settled\n const isGoModTidyAllRequired =\n config.postUpdateOptions?.includes('gomodTidyAll') === true;\n const isGoModTidyRequired =\n !mustSkipGoModTidy &&\n (config.postUpdateOptions?.includes('gomodTidy') === true ||\n config.postUpdateOptions?.includes('gomodTidy1.17') === true ||\n config.postUpdateOptions?.includes('gomodTidyE') === true ||\n isGoModTidyAllRequired ||\n (config.updateType === 'major' && isImportPathUpdateRequired));\n if (isGoModTidyRequired) {\n args = `mod tidy${modFileFlag}${tidyOpts}`;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n\n let goWorkSumFileName = upath.join(goModDir, 'go.work.sum');\n if (useVendor) {\n // If we find a go.work, then use go workspace vendoring.\n const goWorkFile = await findLocalSiblingOrParent(\n goModFileName,\n 'go.work',\n );\n\n if (goWorkFile) {\n goWorkSumFileName = upath.join(\n upath.dirname(goWorkFile),\n 'go.work.sum',\n );\n\n args = 'work vendor';\n logger.debug('using go work vendor');\n execCommands.push(`${cmd} ${args}`);\n\n args = 'work sync';\n logger.debug('using go work sync');\n execCommands.push(`${cmd} ${args}`);\n } else {\n args = `mod vendor${modFileFlag}`;\n logger.debug('using go mod vendor');\n execCommands.push(`${cmd} ${args}`);\n }\n\n if (isGoModTidyRequired) {\n args = `mod tidy${modFileFlag}${tidyOpts}`;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n }\n\n // We tidy one more time as a solution for #6795\n if (isGoModTidyRequired) {\n args = `mod tidy${modFileFlag}${tidyOpts}`;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n\n let dependentModules: string[] = [];\n if (isGoModTidyAllRequired) {\n try {\n dependentModules = await getGoModulesInTidyOrder(goModFileName);\n for (const dependent of dependentModules) {\n const dir = upath.relative(goModDir, upath.dirname(dependent));\n execCommands.push(`${cmd} -C ${quote(dir)} mod tidy${tidyOpts}`);\n }\n logger.debug({ dependentModules }, 'go mod tidy commands included');\n } catch (err) {\n logger.warn({ err }, 'Failed to find dependent Go modules');\n }\n }\n\n if (useGoGenerate) {\n if (goGenerateAllowed) {\n logger.debug('go generate command included');\n execCommands.push(`${cmd} generate ./...`);\n } else {\n logger.once.warn(\n `go generate command requested as a post update action, but goGenerate is not permitted in the allowedUnsafeExecutions`,\n );\n }\n }\n\n await gitExec(execCommands, execOptions);\n\n const status = await getRepoStatus();\n const dependentFiles = dependentModules.flatMap((f) => [\n f,\n f.replace(regEx(/\\.mod$/), '.sum'),\n ]);\n\n if (\n !status.modified.includes(sumFileName) &&\n !status.modified.includes(goModFileName) &&\n !status.modified.includes(goWorkSumFileName) &&\n !dependentFiles.some((f) => status.modified.includes(f))\n ) {\n return null;\n }\n\n const res: UpdateArtifactsResult[] = [];\n if (status.modified.includes(sumFileName)) {\n logger.debug('Returning updated go.sum');\n res.push({\n file: {\n type: 'addition',\n path: sumFileName,\n contents: await readLocalFile(sumFileName),\n },\n });\n }\n\n if (status.modified.includes(goWorkSumFileName)) {\n logger.debug('Returning updated go.work.sum');\n res.push({\n file: {\n type: 'addition',\n path: goWorkSumFileName,\n contents: await readLocalFile(goWorkSumFileName),\n },\n });\n }\n\n for (const f of dependentFiles) {\n if (status.modified.includes(f)) {\n logger.trace(`Returning updated ${f}`);\n res.push({\n file: {\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n },\n });\n }\n }\n\n // Include all the .go file import changes\n if (isImportPathUpdateRequired) {\n logger.debug('Returning updated go source files for import path changes');\n for (const f of status.modified) {\n if (f.endsWith('.go')) {\n res.push({\n file: {\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n },\n });\n }\n }\n }\n\n const alreadyAdded = new Set<string>();\n const alreadyDeleted = new Set<string>();\n if (useVendor) {\n for (const f of status.modified.concat(status.not_added)) {\n if (vendorDir && f.startsWith(vendorDir)) {\n alreadyAdded.add(f);\n res.push({\n file: {\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n },\n });\n }\n }\n for (const f of coerceArray(status.deleted)) {\n if (vendorDir && f.startsWith(vendorDir)) {\n alreadyDeleted.add(f);\n res.push({\n file: {\n type: 'deletion',\n path: f,\n },\n });\n }\n }\n }\n\n // TODO: throws in tests (#22198)\n const finalGoModContent = (await readLocalFile(goModFileName, 'utf8'))!\n .replace(regEx(/\\/\\/ renovate-replace /g), '')\n .replace(regEx(/renovate-replace-bracket/g), ')');\n if (finalGoModContent !== newGoModContent) {\n const artifactResult: UpdateArtifactsResult = {\n file: {\n type: 'addition',\n path: goModFileName,\n contents: finalGoModContent,\n },\n };\n\n const updatedDepNames = filterMap(updatedDeps, (dep) => dep?.depName);\n const extraDepsNotice = getExtraDepsNotice(\n newGoModContent,\n finalGoModContent,\n updatedDepNames,\n config,\n );\n\n if (extraDepsNotice) {\n artifactResult.notice = {\n file: goModFileName,\n message: extraDepsNotice,\n };\n }\n\n logger.debug('Found updated go.mod after go.sum update');\n res.push(artifactResult);\n alreadyAdded.add(goModFileName);\n }\n\n // add all files added when in `go generate` mode.\n // unfortunately there is not a good way as there is with vendoring or go import path updates to detect this.\n // Do this at the very very end to ensure we only capture files which would have been explicitly\n // modified, added, or deleted from a `go generate` invocation\n if (useGoGenerate && goGenerateAllowed) {\n logger.debug(\n 'Updating all modified files since generated files were added',\n );\n for (const f of status.modified.concat(status.created)) {\n if (!alreadyAdded.has(f)) {\n res.push({\n file: {\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n },\n });\n }\n }\n for (const f of coerceArray(status.deleted)) {\n if (!alreadyDeleted.has(f)) {\n res.push({\n file: {\n type: 'deletion',\n path: f,\n },\n });\n }\n }\n }\n return res;\n } catch (err) {\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, 'Failed to update go.sum');\n return [\n {\n artifactError: {\n fileName: sumFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n\nfunction getGoConstraints(content: string): string | undefined {\n // prefer toolchain directive when go.mod has one\n const toolchainMatch = regEx(/^toolchain\\s*go(?<gover>\\d+\\.\\d+\\.\\d+)$/m).exec(\n content,\n );\n const toolchainVer = toolchainMatch?.groups?.gover;\n if (toolchainVer) {\n logger.debug(\n `Using go version ${toolchainVer} found in toolchain directive`,\n );\n return toolchainVer;\n }\n\n // If go.mod doesn't have toolchain directive and has a full go version spec,\n // for example `go 1.23.6`, pick this version, this doesn't match major.minor version spec.\n //\n // This is because when go.mod have same version defined in go directive and toolchain directive,\n // go will remove toolchain directive from go.mod.\n //\n // For example, go will rewrite `go 1.23.5\\ntoolchain go1.23.5` to `go 1.23.5` by default,\n // in this case, the go directive is the toolchain directive.\n const goFullVersion = regEx(/^go\\s*(?<gover>\\d+\\.\\d+\\.\\d+)$/m).exec(content)\n ?.groups?.gover;\n if (goFullVersion) {\n return goFullVersion;\n }\n\n const re = regEx(/^go\\s*(?<gover>\\d+\\.\\d+)$/m);\n const match = re.exec(content);\n if (!match?.groups?.gover) {\n return undefined;\n }\n return `^${match.groups.gover}`;\n}\n\n/**\n * Derive the version of the Go toolchain needed to run this project.\n *\n * This matches with the `golang` Containerbase tool.\n *\n * In precedence order:\n *\n * 1. config: \\`constraints.go\\`\n * 1. \\`go.mod\\`: \\`toolchain\\` directive\n * 1. \\`go.mod\\`: \\`go\\` directive\n * 1. the \\`go\\` constraint collected during extraction\n *\n * NOTE that the \\`constraints.golang\\` is not used (TODO #42601)\n */\nexport async function deriveGoToolchainConstraints(\n config: UpdateArtifactsConfig,\n newGoModContent: string,\n): Promise<string | undefined> {\n return await resolveToolConstraint(config, 'go', () =>\n getGoConstraints(newGoModContent),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCA,MAAM,EAAE,OAAA,SAAO,OAAA,YAAU;AACzB,MAAM,UAAU,mBAAmB,CAAC,IAAI,CAAC;AAEzC,eAAe,wBACb,aACA,QACmB;CAEnB,MAAM,mBAAmB,YAAY,QAClC,EAAE,iBAAiB,CAACA,QAAM,UAAU,CACvC;CACA,IAAI,iBAAiB,SAAS,GAC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OAAO,MACL,8DACF;GACA,KAAK,MAAM,KAAK,OAAO,SAAS,OAAO,OAAO,OAAO,GACnD,IAAI,CAAC,aAAa,IAAI,CAAC,GACrB,IAAI,KAAK,EACP,MAAM;IACJ,MAAM;IACN,MAAM;IACN,UAAU,MAAM,cAAc,CAAC;GACjC,EACF,CAAC;GAGL,KAAK,MAAM,KAAK,YAAY,OAAO,OAAO,GACxC,IAAI,CAAC,eAAe,IAAI,CAAC,GACvB,IAAI,KAAK,EACP,MAAM;IACJ,MAAM;IACN,MAAM;GACR,EACF,CAAC;EAGP;EACA,OAAO;CACT,SAAS,KAAK;EACZ,IAAI,IAAI,YAAA,mBACN,MAAM;EAER,OAAO,MAAM,EAAE,IAAI,GAAG,yBAAyB;EAC/C,OAAO,CACL,EACE,eAAe;GACb,UAAU;GACV,QAAQ,IAAI;EACd,EACF,CACF;CACF;AACF;AAEA,SAAS,iBAAiB,SAAqC;CAK7D,MAAM,eAHiB,MAAM,0CAA0C,CAAC,CAAC,KACvE,OAEgC,CAAC,EAAE,QAAQ;CAC7C,IAAI,cAAc;EAChB,OAAO,MACL,oBAAoB,aAAa,8BACnC;EACA,OAAO;CACT;CAUA,MAAM,gBAAgB,MAAM,iCAAiC,CAAC,CAAC,KAAK,OAAO,CAAC,EACxE,QAAQ;CACZ,IAAI,eACF,OAAO;CAIT,MAAM,QADK,MAAM,4BACF,CAAC,CAAC,KAAK,OAAO;CAC7B,IAAI,CAAC,OAAO,QAAQ,OAClB;CAEF,OAAO,IAAI,MAAM,OAAO;AAC1B;;;;;;;;;;;;;;;AAgBA,eAAsB,6BACpB,QACA,iBAC6B;CAC7B,OAAO,MAAM,sBAAsB,QAAQ,YACzC,iBAAiB,eAAe,CAClC;AACF"}
|
|
1
|
+
{"version":3,"file":"artifacts.js","names":["valid","major","isValid"],"sources":["../../../../lib/modules/manager/gomod/artifacts.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport semver from 'semver';\nimport { quote } from 'shlex';\nimport upath from 'upath';\nimport { GlobalConfig } from '../../../config/global.ts';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { getEnv } from '../../../util/env.ts';\nimport type { ExecOptions } from '../../../util/exec/types.ts';\nimport { filterMap } from '../../../util/filter-map.ts';\nimport {\n ensureCacheDir,\n findLocalSiblingOrParent,\n isValidLocalPath,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs/index.ts';\nimport { withGitEnvironment } from '../../../util/git/exec.ts';\nimport { collectFileChanges } from '../../../util/git/file-changes.ts';\nimport { getRepoStatus } from '../../../util/git/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { isValid } from '../../versioning/semver/index.ts';\nimport type {\n PackageDependency,\n UpdateArtifact,\n UpdateArtifactsConfig,\n UpdateArtifactsResult,\n} from '../types.ts';\nimport {\n artifactErrorResult,\n fileAddition,\n fileChangesToArtifactResults,\n resolveToolConstraint,\n} from '../util.ts';\nimport { getExtraDepsNotice } from './artifacts-extra.ts';\nimport { getGoModulesInTidyOrder } from './package-tree.ts';\n\nconst { major, valid } = semver;\nconst gitExec = withGitEnvironment(['go']);\n\nasync function getUpdateImportPathCmds(\n updatedDeps: PackageDependency[],\n config: UpdateArtifactsConfig,\n): Promise<string[]> {\n // Check if we fail to parse any major versions and log that they're skipped\n const invalidMajorDeps = updatedDeps.filter(\n ({ newVersion }) => !valid(newVersion),\n );\n if (invalidMajorDeps.length > 0) {\n invalidMajorDeps.forEach(({ depName }) =>\n logger.warn(\n { depName },\n 'Ignoring dependency: Could not get major version',\n ),\n );\n }\n\n const updateImportCommands = updatedDeps\n .filter(\n ({ newVersion }) =>\n valid(newVersion) && !newVersion!.endsWith('+incompatible'),\n )\n .map(({ depName, newVersion }) => ({\n depName: depName!,\n newMajor: major(newVersion!),\n }))\n // Skip path updates going from v0 to v1\n .filter(\n ({ depName, newMajor }) =>\n depName.startsWith('gopkg.in/') || newMajor > 1,\n )\n\n .map(\n ({ depName, newMajor }) =>\n `mod upgrade --mod-name=${quote(depName)} -t=${newMajor}`,\n );\n\n if (updateImportCommands.length > 0) {\n let installMarwanModArgs =\n 'install github.com/marwan-at-work/mod/cmd/mod@latest';\n const gomodModCompatibility = await resolveToolConstraint(\n config,\n 'gomodMod',\n );\n if (gomodModCompatibility) {\n if (\n gomodModCompatibility.startsWith('v') &&\n isValid(gomodModCompatibility.replace(regEx(/^v/), ''))\n ) {\n installMarwanModArgs = installMarwanModArgs.replace(\n regEx(/@latest$/),\n `@${gomodModCompatibility}`,\n );\n } else {\n logger.debug(\n { gomodModCompatibility },\n 'marwan-at-work/mod compatibility range is not valid - skipping',\n );\n }\n } else {\n logger.debug(\n 'No marwan-at-work/mod compatibility range found - installing marwan-at-work/mod latest',\n );\n }\n updateImportCommands.unshift(`go ${installMarwanModArgs}`);\n }\n\n return updateImportCommands;\n}\n\nfunction useModcacherw(goVersion: string | undefined): boolean {\n if (!isString(goVersion)) {\n return true;\n }\n\n return semver.intersects(goVersion, `>=1.14`);\n}\n\nexport async function updateArtifacts({\n packageFileName: goModFileName,\n updatedDeps,\n newPackageFileContent: newGoModContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`gomod.updateArtifacts(${goModFileName})`);\n\n const sumFileName = goModFileName.replace(regEx(/\\.mod$/), '.sum');\n const existingGoSumContent = await readLocalFile(sumFileName);\n if (!existingGoSumContent) {\n logger.debug('No go.sum found');\n return null;\n }\n const goModDir = upath.dirname(goModFileName);\n const goModFileBaseName = upath.basename(goModFileName);\n const modFileFlag =\n goModFileBaseName === 'go.mod'\n ? ''\n : ` -modfile=${quote(goModFileBaseName)}`;\n\n // The \"vendor\" directory can be next to the go.mod, but also in the parent directory in case\n // the go workspaces are used.\n const vendorDir = await findLocalSiblingOrParent(goModFileName, 'vendor');\n const vendorModulesFileName = upath.join(vendorDir ?? '', 'modules.txt');\n const useVendor =\n !!config.postUpdateOptions?.includes('gomodVendor') ||\n (!config.postUpdateOptions?.includes('gomodSkipVendor') &&\n vendorDir &&\n (await readLocalFile(vendorModulesFileName)) !== null);\n let massagedGoMod = newGoModContent;\n const useGoGenerate = !!config.postUpdateOptions?.includes('goGenerate');\n const allowedUnsafeExecutions = GlobalConfig.get('allowedUnsafeExecutions');\n const goGenerateAllowed = allowedUnsafeExecutions?.includes('goGenerate');\n\n if (config.postUpdateOptions?.includes('gomodMassage')) {\n // Regex match inline replace directive, example:\n // replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\n // https://go.dev/ref/mod#go-mod-file-replace\n\n // replace bracket after comments, so it doesn't break the regex, doing a complex regex causes problems\n // when there's a comment and \")\" after it, the regex will read replace block until comment.. and stop.\n massagedGoMod = massagedGoMod\n .split('\\n')\n .map((line) => {\n if (line.trim().startsWith('//')) {\n return line.replace(')', 'renovate-replace-bracket');\n }\n return line;\n })\n .join('\\n');\n\n const inlineReplaceRegEx = regEx(\n /(?<newline>\\r?\\n)(?<directive>replace\\s+[^\\s]+\\s+=>\\s+\\.\\.\\/.*)/g,\n );\n\n // $<newline> will be matched with the (\\r?\\n) group\n // $<directive> will be matched with the inline replace match, example\n // \"// renovate-replace replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\"\n const inlineCommentOut = '$<newline>// renovate-replace $<directive>';\n\n // Regex match replace directive block, example:\n // replace (\n // golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\n // )\n const blockReplaceRegEx = regEx(/(?:\\r?\\n)replace\\s*\\([^)]+\\s*\\)/g);\n\n /**\n * replacerFunction for commenting out replace blocks\n * @param match A string representing a golang replace directive block\n * @returns A commented out block with // renovate-replace\n */\n function blockCommentOut(match: string): string {\n return match.replace(\n regEx(/(?<newline>\\r?\\n)/g),\n '$<newline>// renovate-replace ',\n );\n }\n\n // Comment out golang replace directives\n massagedGoMod = massagedGoMod\n .replace(inlineReplaceRegEx, inlineCommentOut)\n .replace(blockReplaceRegEx, blockCommentOut);\n\n // v8 ignore else -- needs a go.mod the replace massaging leaves unchanged\n if (massagedGoMod !== newGoModContent) {\n logger.debug(\n 'Removed some relative replace statements and comments from go.mod',\n );\n }\n }\n const goConstraints = await deriveGoToolchainConstraints(\n config,\n newGoModContent,\n );\n\n try {\n await writeLocalFile(goModFileName, massagedGoMod);\n\n const cmd = 'go';\n const env = getEnv();\n const execOptions: ExecOptions = {\n cwdFile: goModFileName,\n extraEnv: {\n GOPATH: await ensureCacheDir('go'),\n GOPROXY: env.GOPROXY,\n GOPRIVATE: env.GOPRIVATE,\n GONOPROXY: env.GONOPROXY,\n GONOSUMDB: env.GONOSUMDB,\n GOSUMDB: env.GOSUMDB,\n GOINSECURE: env.GOINSECURE,\n /* v8 ignore next -- TODO: add test */\n GOFLAGS: useModcacherw(goConstraints) ? '-modcacherw' : null,\n CGO_ENABLED: GlobalConfig.get('binarySource') === 'docker' ? '0' : null,\n },\n docker: {},\n toolConstraints: [\n {\n toolName: 'golang',\n constraint: goConstraints,\n },\n ],\n };\n\n const execCommands: string[] = [];\n\n let goGetDirs: string | undefined;\n if (config.goGetDirs) {\n goGetDirs = config.goGetDirs\n .filter((dir) => {\n const isValid = isValidLocalPath(dir);\n if (!isValid) {\n logger.warn({ dir }, 'Invalid path in goGetDirs');\n }\n return isValid;\n })\n .map(quote)\n .join(' ');\n\n if (goGetDirs === '') {\n throw new Error('Invalid goGetDirs');\n }\n }\n\n let args = `get${modFileFlag} `;\n\n if (goConstraints && !semver.intersects(goConstraints, `>=1.18`)) {\n // For Go versions < 1.18, we need to use the -d flag to avoid builds or installs\n // https://go.dev/doc/go1.18#go-get\n args += `-d `;\n }\n\n args += `-t ${goGetDirs ?? './...'}`;\n logger.trace({ cmd, args }, 'go get command included');\n execCommands.push(`${cmd} ${args}`);\n\n // Update import paths on major updates\n const isImportPathUpdateRequired =\n config.postUpdateOptions?.includes('gomodUpdateImportPaths') &&\n config.updateType === 'major';\n\n if (isImportPathUpdateRequired) {\n const updateImportCmds = await getUpdateImportPathCmds(\n updatedDeps,\n config,\n );\n if (updateImportCmds.length > 0) {\n logger.debug(updateImportCmds, 'update import path commands included');\n // The updates\n execCommands.push(...updateImportCmds);\n }\n }\n\n const mustSkipGoModTidy =\n !config.postUpdateOptions?.includes('gomodUpdateImportPaths') &&\n config.updateType === 'major';\n if (mustSkipGoModTidy) {\n logger.debug('go mod tidy command skipped');\n }\n\n let tidyOpts = '';\n if (config.postUpdateOptions?.includes('gomodTidy1.17')) {\n tidyOpts += ' -compat=1.17';\n }\n if (config.postUpdateOptions?.includes('gomodTidyE')) {\n tidyOpts += ' -e';\n }\n\n // dependent modules can only be tidied once the updated module is settled\n const isGoModTidyAllRequired =\n config.postUpdateOptions?.includes('gomodTidyAll') === true;\n const isGoModTidyRequired =\n !mustSkipGoModTidy &&\n (config.postUpdateOptions?.includes('gomodTidy') === true ||\n config.postUpdateOptions?.includes('gomodTidy1.17') === true ||\n config.postUpdateOptions?.includes('gomodTidyE') === true ||\n isGoModTidyAllRequired ||\n (config.updateType === 'major' && isImportPathUpdateRequired));\n if (isGoModTidyRequired) {\n args = `mod tidy${modFileFlag}${tidyOpts}`;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n\n let goWorkSumFileName = upath.join(goModDir, 'go.work.sum');\n if (useVendor) {\n // If we find a go.work, then use go workspace vendoring.\n const goWorkFile = await findLocalSiblingOrParent(\n goModFileName,\n 'go.work',\n );\n\n if (goWorkFile) {\n goWorkSumFileName = upath.join(\n upath.dirname(goWorkFile),\n 'go.work.sum',\n );\n\n args = 'work vendor';\n logger.debug('using go work vendor');\n execCommands.push(`${cmd} ${args}`);\n\n args = 'work sync';\n logger.debug('using go work sync');\n execCommands.push(`${cmd} ${args}`);\n } else {\n args = `mod vendor${modFileFlag}`;\n logger.debug('using go mod vendor');\n execCommands.push(`${cmd} ${args}`);\n }\n\n if (isGoModTidyRequired) {\n args = `mod tidy${modFileFlag}${tidyOpts}`;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n }\n\n // We tidy one more time as a solution for #6795\n if (isGoModTidyRequired) {\n args = `mod tidy${modFileFlag}${tidyOpts}`;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n\n let dependentModules: string[] = [];\n if (isGoModTidyAllRequired) {\n try {\n dependentModules = await getGoModulesInTidyOrder(goModFileName);\n for (const dependent of dependentModules) {\n const dir = upath.relative(goModDir, upath.dirname(dependent));\n execCommands.push(`${cmd} -C ${quote(dir)} mod tidy${tidyOpts}`);\n }\n logger.debug({ dependentModules }, 'go mod tidy commands included');\n } catch (err) {\n logger.warn({ err }, 'Failed to find dependent Go modules');\n }\n }\n\n if (useGoGenerate) {\n if (goGenerateAllowed) {\n logger.debug('go generate command included');\n execCommands.push(`${cmd} generate ./...`);\n } else {\n logger.once.warn(\n `go generate command requested as a post update action, but goGenerate is not permitted in the allowedUnsafeExecutions`,\n );\n }\n }\n\n await gitExec(execCommands, execOptions);\n\n const status = await getRepoStatus();\n const dependentFiles = dependentModules.flatMap((f) => [\n f,\n f.replace(regEx(/\\.mod$/), '.sum'),\n ]);\n\n if (\n !status.modified.includes(sumFileName) &&\n !status.modified.includes(goModFileName) &&\n !status.modified.includes(goWorkSumFileName) &&\n !dependentFiles.some((f) => status.modified.includes(f))\n ) {\n return null;\n }\n\n const res: UpdateArtifactsResult[] = [];\n if (status.modified.includes(sumFileName)) {\n logger.debug('Returning updated go.sum');\n res.push(fileAddition(sumFileName, await readLocalFile(sumFileName)));\n }\n\n if (status.modified.includes(goWorkSumFileName)) {\n logger.debug('Returning updated go.work.sum');\n res.push(\n fileAddition(goWorkSumFileName, await readLocalFile(goWorkSumFileName)),\n );\n }\n\n for (const f of dependentFiles) {\n if (status.modified.includes(f)) {\n logger.trace(`Returning updated ${f}`);\n res.push(fileAddition(f, await readLocalFile(f)));\n }\n }\n\n // Include all the .go file import changes\n if (isImportPathUpdateRequired) {\n logger.debug('Returning updated go source files for import path changes');\n for (const f of status.modified) {\n if (f.endsWith('.go')) {\n res.push(fileAddition(f, await readLocalFile(f)));\n }\n }\n }\n\n const alreadyAdded = new Set<string>();\n const alreadyDeleted = new Set<string>();\n if (useVendor) {\n const vendorChanges = await collectFileChanges(status, {\n filter: (f) => !!vendorDir && f.startsWith(vendorDir),\n });\n for (const change of vendorChanges) {\n if (change.type === 'addition') {\n alreadyAdded.add(change.path);\n } else {\n alreadyDeleted.add(change.path);\n }\n }\n res.push(...fileChangesToArtifactResults(vendorChanges));\n }\n\n // TODO: throws in tests (#22198)\n const finalGoModContent = (await readLocalFile(goModFileName, 'utf8'))!\n .replace(regEx(/\\/\\/ renovate-replace /g), '')\n .replace(regEx(/renovate-replace-bracket/g), ')');\n if (finalGoModContent !== newGoModContent) {\n const artifactResult: UpdateArtifactsResult = {\n file: {\n type: 'addition',\n path: goModFileName,\n contents: finalGoModContent,\n },\n };\n\n const updatedDepNames = filterMap(updatedDeps, (dep) => dep?.depName);\n const extraDepsNotice = getExtraDepsNotice(\n newGoModContent,\n finalGoModContent,\n updatedDepNames,\n config,\n );\n\n if (extraDepsNotice) {\n artifactResult.notice = {\n file: goModFileName,\n message: extraDepsNotice,\n };\n }\n\n logger.debug('Found updated go.mod after go.sum update');\n res.push(artifactResult);\n alreadyAdded.add(goModFileName);\n }\n\n // add all files added when in `go generate` mode.\n // unfortunately there is not a good way as there is with vendoring or go import path updates to detect this.\n // Do this at the very very end to ensure we only capture files which would have been explicitly\n // modified, added, or deleted from a `go generate` invocation\n if (useGoGenerate && goGenerateAllowed) {\n logger.debug(\n 'Updating all modified files since generated files were added',\n );\n res.push(\n ...fileChangesToArtifactResults([\n ...(await collectFileChanges(status, {\n include: ['modified', 'created'],\n filter: (f) => !alreadyAdded.has(f),\n })),\n ...(await collectFileChanges(status, {\n include: ['deleted'],\n filter: (f) => !alreadyDeleted.has(f),\n })),\n ]),\n );\n }\n return res;\n } catch (err) {\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, 'Failed to update go.sum');\n return artifactErrorResult(sumFileName, err);\n }\n}\n\nfunction getGoConstraints(content: string): string | undefined {\n // prefer toolchain directive when go.mod has one\n const toolchainMatch = regEx(/^toolchain\\s*go(?<gover>\\d+\\.\\d+\\.\\d+)$/m).exec(\n content,\n );\n const toolchainVer = toolchainMatch?.groups?.gover;\n if (toolchainVer) {\n logger.debug(\n `Using go version ${toolchainVer} found in toolchain directive`,\n );\n return toolchainVer;\n }\n\n // If go.mod doesn't have toolchain directive and has a full go version spec,\n // for example `go 1.23.6`, pick this version, this doesn't match major.minor version spec.\n //\n // This is because when go.mod have same version defined in go directive and toolchain directive,\n // go will remove toolchain directive from go.mod.\n //\n // For example, go will rewrite `go 1.23.5\\ntoolchain go1.23.5` to `go 1.23.5` by default,\n // in this case, the go directive is the toolchain directive.\n const goFullVersion = regEx(/^go\\s*(?<gover>\\d+\\.\\d+\\.\\d+)$/m).exec(content)\n ?.groups?.gover;\n if (goFullVersion) {\n return goFullVersion;\n }\n\n const re = regEx(/^go\\s*(?<gover>\\d+\\.\\d+)$/m);\n const match = re.exec(content);\n if (!match?.groups?.gover) {\n return undefined;\n }\n return `^${match.groups.gover}`;\n}\n\n/**\n * Derive the version of the Go toolchain needed to run this project.\n *\n * This matches with the `golang` Containerbase tool.\n *\n * In precedence order:\n *\n * 1. config: \\`constraints.go\\`\n * 1. \\`go.mod\\`: \\`toolchain\\` directive\n * 1. \\`go.mod\\`: \\`go\\` directive\n * 1. the \\`go\\` constraint collected during extraction\n *\n * NOTE that the \\`constraints.golang\\` is not used (TODO #42601)\n */\nexport async function deriveGoToolchainConstraints(\n config: UpdateArtifactsConfig,\n newGoModContent: string,\n): Promise<string | undefined> {\n return await resolveToolConstraint(config, 'go', () =>\n getGoConstraints(newGoModContent),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,MAAM,EAAE,OAAA,SAAO,OAAA,YAAU;AACzB,MAAM,UAAU,mBAAmB,CAAC,IAAI,CAAC;AAEzC,eAAe,wBACb,aACA,QACm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mBAAmB,QAAQ;IACnC,SAAS,CAAC,SAAS;IACnB,SAAS,MAAM,CAAC,eAAe,IAAI,CAAC;GACtC,CAAC,CACH,CAAC,CACH;EACF;EACA,OAAO;CACT,SAAS,KAAK;EACZ,IAAI,IAAI,YAAA,mBACN,MAAM;EAER,OAAO,MAAM,EAAE,IAAI,GAAG,yBAAyB;EAC/C,OAAO,oBAAoB,aAAa,GAAG;CAC7C;AACF;AAEA,SAAS,iBAAiB,SAAqC;CAK7D,MAAM,eAHiB,MAAM,0CAA0C,CAAC,CAAC,KACvE,OAEgC,CAAC,EAAE,QAAQ;CAC7C,IAAI,cAAc;EAChB,OAAO,MACL,oBAAoB,aAAa,8BACnC;EACA,OAAO;CACT;CAUA,MAAM,gBAAgB,MAAM,iCAAiC,CAAC,CAAC,KAAK,OAAO,CAAC,EACxE,QAAQ;CACZ,IAAI,eACF,OAAO;CAIT,MAAM,QADK,MAAM,4BACF,CAAC,CAAC,KAAK,OAAO;CAC7B,IAAI,CAAC,OAAO,QAAQ,OAClB;CAEF,OAAO,IAAI,MAAM,OAAO;AAC1B;;;;;;;;;;;;;;;AAgBA,eAAsB,6BACpB,QACA,iBAC6B;CAC7B,OAAO,MAAM,sBAAsB,QAAQ,YACzC,iBAAiB,eAAe,CAClC;AACF"}
|
|
@@ -3,11 +3,11 @@ import { regEx } from "../../../util/regex.js";
|
|
|
3
3
|
import { coerceArray } from "../../../util/array.js";
|
|
4
4
|
import { logger } from "../../../logger/index.js";
|
|
5
5
|
import { parseYaml } from "../../../util/yaml.js";
|
|
6
|
-
import { getSiblingFileName
|
|
6
|
+
import { getSiblingFileName } from "../../../util/fs/index.js";
|
|
7
7
|
import { Result } from "../../../util/result.js";
|
|
8
8
|
import { exec } from "../../../util/exec/index.js";
|
|
9
9
|
import { getFile } from "../../../util/git/index.js";
|
|
10
|
-
import { resolveToolConstraint } from "../util.js";
|
|
10
|
+
import { artifactErrorResult, resolveToolConstraint, updateLockFile } from "../util.js";
|
|
11
11
|
import { generateHelmEnvs } from "../helmv3/common.js";
|
|
12
12
|
import { Doc, LockVersion } from "./schema.js";
|
|
13
13
|
import { generateRegistryLoginCmd, isOCIRegistry } from "./utils.js";
|
|
@@ -28,7 +28,6 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
|
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
try {
|
|
31
|
-
await writeLocalFile(packageFileName, newPackageFileContent);
|
|
32
31
|
const toolConstraints = [{
|
|
33
32
|
toolName: "helm",
|
|
34
33
|
constraint: await resolveToolConstraint(config, "helm")
|
|
@@ -52,29 +51,24 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
|
|
|
52
51
|
if (loginCmd) cmd.push(loginCmd);
|
|
53
52
|
}
|
|
54
53
|
cmd.push(`helmfile deps -f ${quote(packageFileName)}`);
|
|
55
|
-
await
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
return await updateLockFile({
|
|
55
|
+
lockFileName,
|
|
56
|
+
existingLockFileContent,
|
|
57
|
+
packageFile: {
|
|
58
|
+
path: packageFileName,
|
|
59
|
+
contents: newPackageFileContent
|
|
60
|
+
},
|
|
61
|
+
run: () => exec(cmd, {
|
|
62
|
+
docker: {},
|
|
63
|
+
extraEnv: generateHelmEnvs(),
|
|
64
|
+
toolConstraints
|
|
65
|
+
})
|
|
59
66
|
});
|
|
60
|
-
const newHelmLockContent = await readLocalFile(lockFileName, "utf8");
|
|
61
|
-
if (existingLockFileContent === newHelmLockContent) {
|
|
62
|
-
logger.debug("helmfile.lock is unchanged");
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
return [{ file: {
|
|
66
|
-
type: "addition",
|
|
67
|
-
path: lockFileName,
|
|
68
|
-
contents: newHelmLockContent
|
|
69
|
-
} }];
|
|
70
67
|
} catch (err) {
|
|
71
|
-
|
|
68
|
+
/* v8 ignore if -- defensive rethrow, not reproduced in the helmfile specs */
|
|
72
69
|
if (err.message === "temporary-error") throw err;
|
|
73
70
|
logger.debug({ err }, "Failed to update Helmfile lock file");
|
|
74
|
-
return
|
|
75
|
-
fileName: lockFileName,
|
|
76
|
-
stderr: err.message
|
|
77
|
-
} }];
|
|
71
|
+
return artifactErrorResult(lockFileName, err);
|
|
78
72
|
}
|
|
79
73
|
}
|
|
80
74
|
//#endregion
|