renovate 44.90.3 → 44.91.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/options/index.js +1 -1
- package/dist/config/options/index.js.map +1 -1
- package/dist/global-config-option-defaults.generated.js +1 -1
- package/dist/global-config-option-defaults.generated.js.map +1 -1
- package/dist/modules/manager/ansible-galaxy/collections.js +4 -6
- package/dist/modules/manager/ansible-galaxy/collections.js.map +1 -1
- package/dist/modules/manager/azure-pipelines/extract.js +1 -0
- package/dist/modules/manager/azure-pipelines/extract.js.map +1 -1
- package/dist/modules/manager/bazel/artifacts.js +5 -1
- package/dist/modules/manager/bazel/artifacts.js.map +1 -1
- package/dist/modules/manager/bazel/parser.js +15 -0
- package/dist/modules/manager/bazel/parser.js.map +1 -1
- package/dist/modules/manager/bazel/rules/http.js.map +1 -1
- package/dist/modules/manager/bundler/common.js +1 -0
- package/dist/modules/manager/bundler/common.js.map +1 -1
- package/dist/modules/manager/cargo/artifacts.js +2 -0
- package/dist/modules/manager/cargo/artifacts.js.map +1 -1
- package/dist/modules/manager/cargo/extract.js.map +1 -1
- package/dist/modules/manager/cocoapods/extract.js +3 -0
- package/dist/modules/manager/cocoapods/extract.js.map +1 -1
- package/dist/modules/manager/composer/artifacts.js +1 -0
- package/dist/modules/manager/composer/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/schema.js.map +1 -1
- package/dist/modules/manager/cpanfile/parser.js +2 -0
- package/dist/modules/manager/cpanfile/parser.js.map +1 -1
- package/dist/modules/manager/deps-edn/extract.js +3 -1
- package/dist/modules/manager/deps-edn/extract.js.map +1 -1
- package/dist/modules/manager/droneci/extract.js +4 -6
- package/dist/modules/manager/droneci/extract.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +11 -11
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/flux/extract.js +1 -0
- package/dist/modules/manager/flux/extract.js.map +1 -1
- package/dist/modules/manager/github-actions/extract.js +3 -0
- package/dist/modules/manager/github-actions/extract.js.map +1 -1
- package/dist/modules/manager/github-actions/known-actions.js +38 -2
- package/dist/modules/manager/github-actions/known-actions.js.map +1 -1
- package/dist/modules/manager/gitlabci/extract.js +1 -0
- package/dist/modules/manager/gitlabci/extract.js.map +1 -1
- package/dist/modules/manager/glasskube/extract.js +2 -0
- package/dist/modules/manager/glasskube/extract.js.map +1 -1
- package/dist/modules/manager/gomod/artifacts-extra.js +1 -0
- package/dist/modules/manager/gomod/artifacts-extra.js.map +1 -1
- package/dist/modules/manager/gomod/artifacts.js +1 -0
- package/dist/modules/manager/gomod/artifacts.js.map +1 -1
- package/dist/modules/manager/gomod/extract.js +1 -0
- package/dist/modules/manager/gomod/extract.js.map +1 -1
- package/dist/modules/manager/gradle/artifacts.js +1 -1
- package/dist/modules/manager/gradle/artifacts.js.map +1 -1
- package/dist/modules/manager/gradle-wrapper/utils.js +1 -0
- package/dist/modules/manager/gradle-wrapper/utils.js.map +1 -1
- package/dist/modules/manager/npm/extract/common/dependency.js +2 -1
- package/dist/modules/manager/npm/extract/common/dependency.js.map +1 -1
- package/dist/modules/manager/pep621/extract.js +1 -2
- package/dist/modules/manager/pep621/extract.js.map +1 -1
- package/dist/modules/manager/quadlet/extract.js +2 -4
- package/dist/modules/manager/quadlet/extract.js.map +1 -1
- package/dist/modules/manager/swift/artifacts.js +3 -1
- package/dist/modules/manager/swift/artifacts.js.map +1 -1
- package/dist/modules/manager/swift/extract.js +1 -0
- package/dist/modules/manager/swift/extract.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/others/modules.js.map +1 -1
- package/dist/modules/manager/terraform/lockfile/index.js +1 -0
- package/dist/modules/manager/terraform/lockfile/index.js.map +1 -1
- package/dist/modules/manager/terragrunt/extract.js +1 -0
- package/dist/modules/manager/terragrunt/extract.js.map +1 -1
- package/dist/modules/manager/tflint-plugin/extract.js +1 -0
- package/dist/modules/manager/tflint-plugin/extract.js.map +1 -1
- package/dist/modules/manager/tflint-plugin/plugins.js.map +1 -1
- package/package.json +1 -1
- package/renovate-schema.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fingerprint.generated.js","names":[],"sources":["../../../lib/modules/manager/fingerprint.generated.ts"],"sourcesContent":["export const hashMap = new Map<string, string>();\n\nhashMap.set('ansible','a52394a36ac5517f7330473c31d93aa05b2ce607c5e951b48f25a4693cd20a81');\nhashMap.set('ansible-galaxy','0a264d6be73953d801510fdeff271e4071c274339569c6dab4e2a128eaf4869f');\nhashMap.set('ant','2df5943cf0ed19a21b94df13729dbb925655548130caf37e3e22bebaed518e17');\nhashMap.set('apm','ca7c2342c04489253cd8f38d294a4c1428010115c2be22b3e0812dacf9881244');\nhashMap.set('argocd','cff9cd22257bc460ae4b9936570bf0ed5585f280a55d26629deaeeb0bfee8eb5');\nhashMap.set('asdf','430eb99b58171700c8a59c78b9e648575e9b176b781d90dd10a710f7b69015bb');\nhashMap.set('azure-pipelines','6bf7782e8a02fc87dc5d84aab59e517c09df51fd23cf57805e62207dbd5efdb5');\nhashMap.set('batect','375d39b432013bedb1330cf40a2199dd822751b28578214f219e7bab98594b8d');\nhashMap.set('batect-wrapper','d999355511ea7f4053325a18b8cfc8d2b586c61e6760c35e557d383a673e3939');\nhashMap.set('bazel','ef00591c6f09069550ef97ff7ff5e387b9dd3df51cdecc9ef941169b19315396');\nhashMap.set('bazel-module','9fbba0339f9f7785d52ab85c5f0f6385003093c063483c13feccba13ae438bef');\nhashMap.set('bazelisk','770f75a746dc6ba90c518788d5987d7df4243ef9eee122d1bb0556a93d6e1b11');\nhashMap.set('bicep','7246e0bfc06e0e28cbb03ac088c5591f648956b086e106aeb251fe5d628329db');\nhashMap.set('bitbucket-pipelines','59c0503494ab1442b127914503c01b97ac17b6742b19c632292d5aa24de115cd');\nhashMap.set('bitrise','478dfd316221fad7c29e177c70d1018d832fb2626b53308a5d0f1f0380e69f42');\nhashMap.set('buildkite','b8b404f53cd5d61c39153fddf93945e621471c4ac6aa9960c881cd868922bb4c');\nhashMap.set('buildpacks','6bef3cb04d66b5cfbb195adb4829bcbccae6408518706744d291bacf0610421f');\nhashMap.set('bun','684f46dd3cef4d30f9e4ae97c384a38d032ebf3d0bfe9b471ab1772c7b26827a');\nhashMap.set('bun-version','df3ae8e4a5de1fa1b4544f3d7fc8117e80adb1e151c46d1ede54a4dbea6521e4');\nhashMap.set('bundler','c8b4b76b89a2357cacdc34adfab00dcde862103121386552d17cca5761b533ec');\nhashMap.set('cake','9ebd8b481220b30a8860121d26184540a1a2fcc05ef780df9295dea39b386fad');\nhashMap.set('cargo','63721e2683b30cffc5ba87c75f919dc61a555f7741fa479f7446ef98c0ae9d5d');\nhashMap.set('cdnurl','9a81c8e3c6ad6c788498c99fc1067ffdfcd92a427c3afaf8c0130975d83131f2');\nhashMap.set('circleci','91cbeb33ea20f9838e2c81a1195eb806f0b38fa282bc3679f62552f20575ca85');\nhashMap.set('cloudbuild','f4e40388944652c8a19f8518771ac8d3f3c4ccf81ddef0e68b463aca833cb73c');\nhashMap.set('cocoapods','f832e2beef885bb3fd697ed9bb3e8cd742926bfec37ff41212edd2dbb4edb3ba');\nhashMap.set('composer','74a802074ed550801b7536d36ed9880e3a95ae8f340c590446c017fb3ef36de9');\nhashMap.set('conan','8d46e9a30ae628e26118aea10a98d1b846f7c5d96d51ce24693437d555f6d125');\nhashMap.set('copier','10ae4d7f8ff35faf3a3f9f25bf4c969ea960e19aaf8c012aee11f93f4d10533e');\nhashMap.set('cpanfile','07813fec3f3c2197056500e9266a0553b9774c02f2c74d5ca2e213188c7c12d3');\nhashMap.set('crossplane','5c26b1201a1a51454ffb94d829e223a76a781569bf79cdb1e47087c30233ec40');\nhashMap.set('crow','eb9a5f9f95041855dded67bcce3dd54724f690995ed6268d272e8a666ff28fd0');\nhashMap.set('deno','917fdbfbad58fd7f57933646a760d91768368df563ce5eaf34a2bba165164a12');\nhashMap.set('deps-edn','7b6ac92be04b44fdf1da8755550a6417bb294908158119c8fff10adeb05048d2');\nhashMap.set('devbox','a40050cc61bd9b5d500ec111abb17bb15d5f82ab5b7699f66f628307ba8382c9');\nhashMap.set('devcontainer','24320ed1cb6191d04cb8b2707214d82c08c682597aed1d84f250aa00ad1632ec');\nhashMap.set('docker-compose','a9c27711356fbda8dd14f21e046936e1e43f18c5528325b468d89937f76fe1e7');\nhashMap.set('dockerfile','a83e9e93f31576697d45fd60a0b44f7d14a610752e695a62507624ab2dbb2162');\nhashMap.set('droneci','e2039bb37c2d63c53027b188d1f0faa7c8923dcbfe6cf3851fba8d4e9f43a358');\nhashMap.set('fleet','4942d52e82f35c41e2d46cf76f426e2d91b350338cfc0bbcb97e8aaae2a1ac0b');\nhashMap.set('flux','c67562b40cc7cd5e22b4c1ac642fc92ef46db79da9cea174e8aefcc20dde9811');\nhashMap.set('fvm','9b161df0f14bc6e536368952adf373e343630097121a913cea60ee284027fb90');\nhashMap.set('git-submodules','df8bb92b2906d8cddda2d4b302ee503f8002e3554d32d74cef2f584fe891f38f');\nhashMap.set('github-actions','74bd499fe795d957113e26765b9d36dde5b16d7f5c58197eb8ab25826afe55f6');\nhashMap.set('gitlabci','a5e1e66ef461e1c1e71062f85f35a212417e23627f4b002810f9a98295d6e672');\nhashMap.set('gitlabci-include','8860a15ab516fde00694f9bd9bf56fce4addafe5a55b5ddb9a4ec477d301d351');\nhashMap.set('glasskube','93e7b9000a17efa15a1abaaf320b5af9169b1ecd828fc0c881d98570ef9d9e30');\nhashMap.set('gleam','5e9b9f5f914afe5ed7b526c06c65111e3716d2dea9b0cbe7907bbc96db1064a3');\nhashMap.set('gomod','fa22f3f0b0af7b7f769cf3541bd38fdf67365965ce6c8a470f88155958991c24');\nhashMap.set('gradle','9e3ff52ce4ad2555929acdd4d32c417c4ef8714c23a92f2893ecc580fa4d6064');\nhashMap.set('gradle-wrapper','73ba30c34955fab7737454b5cff9aca6d1b5607d53c17c9e13d8ad96f6eaae87');\nhashMap.set('haskell-cabal','f158b7725e3143dfd2950e3de0bbccc2a61cd7eba87f7a54c5057e01252348e2');\nhashMap.set('helm-requirements','7ee9dace4c036dfe113c0c0e46369d8b83a739caa831660142ca98d3236a180a');\nhashMap.set('helm-values','01069e887d4f3b55ca62a3c0dc66d8620264e1426207be9eb240a10c1ad5e412');\nhashMap.set('helmfile','163baefbe5323bb5e671a73b72eaaecfbd03b798c70fd4117e191e143f2f7a4f');\nhashMap.set('helmsman','951deeb3355da751ef39c9e932b26ea749450e32e75759e4b5fc29359e100b37');\nhashMap.set('helmv3','4a3cf47072978eb131d70cd13f3d0bbd4408b0290be2a798a4cbf6103189269b');\nhashMap.set('hermit','0fb25b7766c3a264fbb765ff75b1542b24136c4c9f933696d4a5aecfed637071');\nhashMap.set('homeassistant-manifest','05043c6db870cffbb6f8f3e351c025e3de227eaae0b24134b796aec46f84b65f');\nhashMap.set('homebrew','9c64a4f1475b1c2052372e566c9190f32ae8acd1c54313031d55ae8772388367');\nhashMap.set('html','81fa6c2bf2b868596584a48b949645207a2aa3081951ed99183ee50b70b77d5f');\nhashMap.set('jenkins','7bfb09418a132e052579196633bac78ac947cf93f1e70748ea1b3da929874b87');\nhashMap.set('jsonnet-bundler','4cedeb0394e5c38361d1868ff45b4f34747ab8c492378b6e63dcaf1f4f3c024d');\nhashMap.set('kotlin-script','95ebc844c040ca047321b207d525220e29774a2a1fe06f9639e8353c66908564');\nhashMap.set('kubernetes','321e7d77fb3600dd4c00a86eaa1294927e7f92300b74fa2977d813dcaa3bb4de');\nhashMap.set('kustomize','eb9d6d6aa65a738d6c658a6c9a73a9e86761360a608cf0ba8000d6c554dbc0c7');\nhashMap.set('leiningen','a7295160ce901e08e12be75cb3aaf6b9a199de811eb60b618feb773f7c552bba');\nhashMap.set('maven','c110b99291c2a5bc82cf7a69330275e9bbd7dc8ba3e9e987611dfcffbe002d8d');\nhashMap.set('maven-wrapper','6e53b6e4abf1d20b75094c7a70d66b4a5ac39954f009aa401f5e55dada8be4d0');\nhashMap.set('meteor','4636a47ba4dcfff19fe662572ef7a40d17146be3c966e00ef437e1fc8de92776');\nhashMap.set('mint','248fe4f1ea5c985921c286785792c97e06fc41f402b2d45df82f6aecd17f710e');\nhashMap.set('mise','10f20b75f727142938939b2b3cd7e0f77c3a37567f2b8b7ef78cef9a4908936e');\nhashMap.set('mix','0f79163dc2a1c896599d152be635c23beaf16812ae3d8fbfffec98c7bd0de872');\nhashMap.set('nix','0f80f0b81f2197a7e588be5c115a32a826fc184593f4e879f7b60fafd97a977e');\nhashMap.set('nodenv','ac652c28481b001f7471f4183eac07b45d98ecbe83efc275830b0a1b2e0459b8');\nhashMap.set('npm','30c78bc1c29eeecbdedb4eacc52bd93eedfb07279fd385f893193dcac6196466');\nhashMap.set('nuget','d6acdee647e7e0f3568c46154a2e32c425e44b1044634919530e234035eddeff');\nhashMap.set('nvm','3eb77c7b0acf6d64753de78fad2499b352719853aa6872878c40675d14152322');\nhashMap.set('ocb','032b216684c14b0954e0bb019513a2aca3faaee5748587acb668d377d7c891ca');\nhashMap.set('osgi','d6567a733ef3983112b46fdccd7ceebfcd48411104e0c6b6e714d4310db48024');\nhashMap.set('pep621','52450676f8b0e05134b3e8947b832195ef40bcaec1ce43d71351a2f797b80d75');\nhashMap.set('pep723','b96683163de63ed93207ec0538066705b1e58a1cd5b8bd11c63fc28b26bddba1');\nhashMap.set('pip-compile','7e418b8bdaeed38c1372eb19e0ae1c64999000e128d8754e37368638037b4c5c');\nhashMap.set('pip_requirements','bf3a407f72abf711230247bef94ba5dc84c08a35107b0f017912fad66afa716a');\nhashMap.set('pip_setup','df18fba2bdcf48f3ca12a8f7e5cd28df31e2368d5528127277038ef4206eca79');\nhashMap.set('pipenv','cd974eadd649ba8c9c2e3c7b564a49c8bb2ce95d6df043a7e942364f574c7613');\nhashMap.set('pixi','83f94ec64144ce2adad0901844ab1e9c1636bb5c77bd6578b22b98ab401d34b4');\nhashMap.set('poetry','b2b917c200d25e01a3a198deb3bf33353535f27430142111cfab816c03bb966d');\nhashMap.set('pre-commit','a8fa968d6308947c8a6eedd799ea449e548e918971acdc250b627e86a446dc23');\nhashMap.set('proto','412053d4550026b4ace490b46e970915b87ec1abf0b0a0c6c8c58ccf1fc16843');\nhashMap.set('pub','8e7c65dfd1999de4f7c44392e949a4d8f4701eb86df59d550e4657feb06b1872');\nhashMap.set('puppet','ba58ab689e44acc8f61c3569ab8b40fde01b8a9d3aad712708e2a419e57d8b45');\nhashMap.set('pyenv','9ede8becc97774f9040b40f4472d3e933534b596e04c360bfe0f3c6f95f25182');\nhashMap.set('quadlet','e1fc88a4e14cd595e89bb3d79b4adf2add3ce5eb80f75276e712c32598cca53d');\nhashMap.set('renovate-config','ca60beee2e3b871ea1216fa9df9a501f7ed355fe7da29e12509e56a124a78e69');\nhashMap.set('ruby-version','2db2140d9eee8c555e729a4de0396fa2d78846d3149890ee12fa515bd654be97');\nhashMap.set('runtime-version','b582b168c0cc595e39010feb10f4b97a82683eb269e9598216fbb11cc186e160');\nhashMap.set('rust-toolchain','6ace53db02874d73620d2d872291839820a512a9529c42d174358c692e5db720');\nhashMap.set('sbt','2bb0c98d231bbd6c9043127bfc566a954e7e04fc8654b119c14438a63371e4a7');\nhashMap.set('scalafmt','9d36159b56835e96498af026a1fb0543200db0581681ef95ec54988f411e180f');\nhashMap.set('setup-cfg','4a3a7c812d34739c07685691e7e64c7d3127f9d7d4aff99dc45a25df97ed9745');\nhashMap.set('smithy','9641b91d065ffb63be0dd888139a0402dba41e550f8b44c592db9daf52109100');\nhashMap.set('sveltos','60dd75bb53ace31217211100d622fdb65068c6162758b6ae7103a6ce8bdc9f90');\nhashMap.set('swift','5ebd875ee7a541b4725f6263789ea9a7c77a4b7c40b2119f894e67b588cfa672');\nhashMap.set('tekton','33948f5bdf7553909fa63744adb26da97ddf366e9499bccab1250879570267c9');\nhashMap.set('terraform','d1d5e54517e6075035b4c03de3419f09008c661587ad16a7d8bada4150a92f6f');\nhashMap.set('terraform-version','ec8f786b9731d47f2c2fe0307caf64d7ddd83046fe7ff1f7d8423239f8b0f2aa');\nhashMap.set('terragrunt','ffcbaa67dd65f064d43f8c121c1006115eab1879c4bd38de263b9b90a009c118');\nhashMap.set('terragrunt-version','eea6087b33717d22ede2fc68c2f64df8390b75abe82110ed831a180648feb51d');\nhashMap.set('tflint-plugin','31247d37bc80aae17039bfa21bd989c5717730c5ef10cf2a6f09841576d012ec');\nhashMap.set('travis','04c94f72622003195c8ea8147c8fbd93003f444ec807ce33f2ada2384282db83');\nhashMap.set('typst','d080a79fbd961c6e21fcc505d544b7e0ff2126142acb1dcabdf6abbcd9339248');\nhashMap.set('unity3d','f13e25e115e3443f4e16cf31578acffa78fb1a5e23339680a92d8d6de6052920');\nhashMap.set('velaci','fda00ddb7cc23e9a37e0a8a253151df0a6930b4276d3e4f78cc54b9ac09af7de');\nhashMap.set('vendir','7db907b3b77ef5f3465f3c4339fbab56bbcdfd1bf34b3d33e4c178d2e07e23e7');\nhashMap.set('woodpecker','6110d3bec33aaeb3511d4bbfa896cec3c8e02fb04a6cff50c9ba81061c851045');\nhashMap.set('xcodegen','dad511d88a9ce1dbdde8b9731f3da7f2bdaa4ca8a083294ee58d56da62ab1683');\nhashMap.set('jsonata','416bcf61144b276b3112814c6e6d261aa29608f46fbb0516c471d35c16f8f0d7');\nhashMap.set('regex','20be5247fdc164173871a051acb0527da017d0c155c653d7563601f55e7b3ff5');"],"mappings":";AAAA,MAAa,0BAAU,IAAI,IAAoB;AAE/C,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/F,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,QAAO,kEAAkE;AACrF,QAAQ,IAAI,mBAAkB,kEAAkE;AAChG,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/F,QAAQ,IAAI,SAAQ,kEAAkE;AACtF,Q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E;AACzF,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,SAAQ,kEAAkE"}
|
|
1
|
+
{"version":3,"file":"fingerprint.generated.js","names":[],"sources":["../../../lib/modules/manager/fingerprint.generated.ts"],"sourcesContent":["export const hashMap = new Map<string, string>();\n\nhashMap.set('ansible','a52394a36ac5517f7330473c31d93aa05b2ce607c5e951b48f25a4693cd20a81');\nhashMap.set('ansible-galaxy','0a264d6be73953d801510fdeff271e4071c274339569c6dab4e2a128eaf4869f');\nhashMap.set('ant','2df5943cf0ed19a21b94df13729dbb925655548130caf37e3e22bebaed518e17');\nhashMap.set('apm','ca7c2342c04489253cd8f38d294a4c1428010115c2be22b3e0812dacf9881244');\nhashMap.set('argocd','cff9cd22257bc460ae4b9936570bf0ed5585f280a55d26629deaeeb0bfee8eb5');\nhashMap.set('asdf','430eb99b58171700c8a59c78b9e648575e9b176b781d90dd10a710f7b69015bb');\nhashMap.set('azure-pipelines','a051fe5e7e4fef8208b5864131a2b52b4ae319936f1dd8ee5a4e1ef11359ec09');\nhashMap.set('batect','375d39b432013bedb1330cf40a2199dd822751b28578214f219e7bab98594b8d');\nhashMap.set('batect-wrapper','d999355511ea7f4053325a18b8cfc8d2b586c61e6760c35e557d383a673e3939');\nhashMap.set('bazel','e5f354a1370b544c6e220880f11cfc11a2e95d2d172dae7d008ef0f65e8693ef');\nhashMap.set('bazel-module','9fbba0339f9f7785d52ab85c5f0f6385003093c063483c13feccba13ae438bef');\nhashMap.set('bazelisk','770f75a746dc6ba90c518788d5987d7df4243ef9eee122d1bb0556a93d6e1b11');\nhashMap.set('bicep','7246e0bfc06e0e28cbb03ac088c5591f648956b086e106aeb251fe5d628329db');\nhashMap.set('bitbucket-pipelines','59c0503494ab1442b127914503c01b97ac17b6742b19c632292d5aa24de115cd');\nhashMap.set('bitrise','478dfd316221fad7c29e177c70d1018d832fb2626b53308a5d0f1f0380e69f42');\nhashMap.set('buildkite','b8b404f53cd5d61c39153fddf93945e621471c4ac6aa9960c881cd868922bb4c');\nhashMap.set('buildpacks','6bef3cb04d66b5cfbb195adb4829bcbccae6408518706744d291bacf0610421f');\nhashMap.set('bun','684f46dd3cef4d30f9e4ae97c384a38d032ebf3d0bfe9b471ab1772c7b26827a');\nhashMap.set('bun-version','df3ae8e4a5de1fa1b4544f3d7fc8117e80adb1e151c46d1ede54a4dbea6521e4');\nhashMap.set('bundler','6e4784dd98c1f86ef64cc8cbf3128df48aebf920032d7792b54fdedd3dd9d4d5');\nhashMap.set('cake','9ebd8b481220b30a8860121d26184540a1a2fcc05ef780df9295dea39b386fad');\nhashMap.set('cargo','63721e2683b30cffc5ba87c75f919dc61a555f7741fa479f7446ef98c0ae9d5d');\nhashMap.set('cdnurl','9a81c8e3c6ad6c788498c99fc1067ffdfcd92a427c3afaf8c0130975d83131f2');\nhashMap.set('circleci','91cbeb33ea20f9838e2c81a1195eb806f0b38fa282bc3679f62552f20575ca85');\nhashMap.set('cloudbuild','f4e40388944652c8a19f8518771ac8d3f3c4ccf81ddef0e68b463aca833cb73c');\nhashMap.set('cocoapods','f832e2beef885bb3fd697ed9bb3e8cd742926bfec37ff41212edd2dbb4edb3ba');\nhashMap.set('composer','99ad5e0c0b479ae571e8f018e6d312c0e418f4800a6583b997b0e32d9058e9bd');\nhashMap.set('conan','8d46e9a30ae628e26118aea10a98d1b846f7c5d96d51ce24693437d555f6d125');\nhashMap.set('copier','10ae4d7f8ff35faf3a3f9f25bf4c969ea960e19aaf8c012aee11f93f4d10533e');\nhashMap.set('cpanfile','07813fec3f3c2197056500e9266a0553b9774c02f2c74d5ca2e213188c7c12d3');\nhashMap.set('crossplane','5c26b1201a1a51454ffb94d829e223a76a781569bf79cdb1e47087c30233ec40');\nhashMap.set('crow','eb9a5f9f95041855dded67bcce3dd54724f690995ed6268d272e8a666ff28fd0');\nhashMap.set('deno','917fdbfbad58fd7f57933646a760d91768368df563ce5eaf34a2bba165164a12');\nhashMap.set('deps-edn','8a35b7e6e5ec375d8411cd40fa8eed836ba5aab02efe8ed8819861b41490da1b');\nhashMap.set('devbox','a40050cc61bd9b5d500ec111abb17bb15d5f82ab5b7699f66f628307ba8382c9');\nhashMap.set('devcontainer','24320ed1cb6191d04cb8b2707214d82c08c682597aed1d84f250aa00ad1632ec');\nhashMap.set('docker-compose','d806fc9ff52673b78587c6c58789b66987b046e3fd0b16e4f6d57aca078e9bca');\nhashMap.set('dockerfile','e491725880d930dfd0d58db135b31c0cc5bb6ff5e87f9e813c78bc0cf03b580c');\nhashMap.set('droneci','e2039bb37c2d63c53027b188d1f0faa7c8923dcbfe6cf3851fba8d4e9f43a358');\nhashMap.set('fleet','4942d52e82f35c41e2d46cf76f426e2d91b350338cfc0bbcb97e8aaae2a1ac0b');\nhashMap.set('flux','aad8c786c4a2b5820663027452eeb8fe84c3af8c8399261e85f0eade2e484fe8');\nhashMap.set('fvm','9b161df0f14bc6e536368952adf373e343630097121a913cea60ee284027fb90');\nhashMap.set('git-submodules','df8bb92b2906d8cddda2d4b302ee503f8002e3554d32d74cef2f584fe891f38f');\nhashMap.set('github-actions','cf5340c54bb22a81bbc38c55daf69f6b0556574e8603f09e5f7ddd21e0aec176');\nhashMap.set('gitlabci','a5e1e66ef461e1c1e71062f85f35a212417e23627f4b002810f9a98295d6e672');\nhashMap.set('gitlabci-include','8860a15ab516fde00694f9bd9bf56fce4addafe5a55b5ddb9a4ec477d301d351');\nhashMap.set('glasskube','93e7b9000a17efa15a1abaaf320b5af9169b1ecd828fc0c881d98570ef9d9e30');\nhashMap.set('gleam','5e9b9f5f914afe5ed7b526c06c65111e3716d2dea9b0cbe7907bbc96db1064a3');\nhashMap.set('gomod','fa22f3f0b0af7b7f769cf3541bd38fdf67365965ce6c8a470f88155958991c24');\nhashMap.set('gradle','9e3ff52ce4ad2555929acdd4d32c417c4ef8714c23a92f2893ecc580fa4d6064');\nhashMap.set('gradle-wrapper','73ba30c34955fab7737454b5cff9aca6d1b5607d53c17c9e13d8ad96f6eaae87');\nhashMap.set('haskell-cabal','f158b7725e3143dfd2950e3de0bbccc2a61cd7eba87f7a54c5057e01252348e2');\nhashMap.set('helm-requirements','7ee9dace4c036dfe113c0c0e46369d8b83a739caa831660142ca98d3236a180a');\nhashMap.set('helm-values','01069e887d4f3b55ca62a3c0dc66d8620264e1426207be9eb240a10c1ad5e412');\nhashMap.set('helmfile','163baefbe5323bb5e671a73b72eaaecfbd03b798c70fd4117e191e143f2f7a4f');\nhashMap.set('helmsman','951deeb3355da751ef39c9e932b26ea749450e32e75759e4b5fc29359e100b37');\nhashMap.set('helmv3','4a3cf47072978eb131d70cd13f3d0bbd4408b0290be2a798a4cbf6103189269b');\nhashMap.set('hermit','0fb25b7766c3a264fbb765ff75b1542b24136c4c9f933696d4a5aecfed637071');\nhashMap.set('homeassistant-manifest','05043c6db870cffbb6f8f3e351c025e3de227eaae0b24134b796aec46f84b65f');\nhashMap.set('homebrew','9c64a4f1475b1c2052372e566c9190f32ae8acd1c54313031d55ae8772388367');\nhashMap.set('html','81fa6c2bf2b868596584a48b949645207a2aa3081951ed99183ee50b70b77d5f');\nhashMap.set('jenkins','7bfb09418a132e052579196633bac78ac947cf93f1e70748ea1b3da929874b87');\nhashMap.set('jsonnet-bundler','4cedeb0394e5c38361d1868ff45b4f34747ab8c492378b6e63dcaf1f4f3c024d');\nhashMap.set('kotlin-script','95ebc844c040ca047321b207d525220e29774a2a1fe06f9639e8353c66908564');\nhashMap.set('kubernetes','321e7d77fb3600dd4c00a86eaa1294927e7f92300b74fa2977d813dcaa3bb4de');\nhashMap.set('kustomize','eb9d6d6aa65a738d6c658a6c9a73a9e86761360a608cf0ba8000d6c554dbc0c7');\nhashMap.set('leiningen','a7295160ce901e08e12be75cb3aaf6b9a199de811eb60b618feb773f7c552bba');\nhashMap.set('maven','c110b99291c2a5bc82cf7a69330275e9bbd7dc8ba3e9e987611dfcffbe002d8d');\nhashMap.set('maven-wrapper','6e53b6e4abf1d20b75094c7a70d66b4a5ac39954f009aa401f5e55dada8be4d0');\nhashMap.set('meteor','4636a47ba4dcfff19fe662572ef7a40d17146be3c966e00ef437e1fc8de92776');\nhashMap.set('mint','248fe4f1ea5c985921c286785792c97e06fc41f402b2d45df82f6aecd17f710e');\nhashMap.set('mise','10f20b75f727142938939b2b3cd7e0f77c3a37567f2b8b7ef78cef9a4908936e');\nhashMap.set('mix','0f79163dc2a1c896599d152be635c23beaf16812ae3d8fbfffec98c7bd0de872');\nhashMap.set('nix','0f80f0b81f2197a7e588be5c115a32a826fc184593f4e879f7b60fafd97a977e');\nhashMap.set('nodenv','ac652c28481b001f7471f4183eac07b45d98ecbe83efc275830b0a1b2e0459b8');\nhashMap.set('npm','30c78bc1c29eeecbdedb4eacc52bd93eedfb07279fd385f893193dcac6196466');\nhashMap.set('nuget','d6acdee647e7e0f3568c46154a2e32c425e44b1044634919530e234035eddeff');\nhashMap.set('nvm','3eb77c7b0acf6d64753de78fad2499b352719853aa6872878c40675d14152322');\nhashMap.set('ocb','032b216684c14b0954e0bb019513a2aca3faaee5748587acb668d377d7c891ca');\nhashMap.set('osgi','d6567a733ef3983112b46fdccd7ceebfcd48411104e0c6b6e714d4310db48024');\nhashMap.set('pep621','52450676f8b0e05134b3e8947b832195ef40bcaec1ce43d71351a2f797b80d75');\nhashMap.set('pep723','b96683163de63ed93207ec0538066705b1e58a1cd5b8bd11c63fc28b26bddba1');\nhashMap.set('pip-compile','7e418b8bdaeed38c1372eb19e0ae1c64999000e128d8754e37368638037b4c5c');\nhashMap.set('pip_requirements','bf3a407f72abf711230247bef94ba5dc84c08a35107b0f017912fad66afa716a');\nhashMap.set('pip_setup','df18fba2bdcf48f3ca12a8f7e5cd28df31e2368d5528127277038ef4206eca79');\nhashMap.set('pipenv','cd974eadd649ba8c9c2e3c7b564a49c8bb2ce95d6df043a7e942364f574c7613');\nhashMap.set('pixi','83f94ec64144ce2adad0901844ab1e9c1636bb5c77bd6578b22b98ab401d34b4');\nhashMap.set('poetry','b2b917c200d25e01a3a198deb3bf33353535f27430142111cfab816c03bb966d');\nhashMap.set('pre-commit','a8fa968d6308947c8a6eedd799ea449e548e918971acdc250b627e86a446dc23');\nhashMap.set('proto','412053d4550026b4ace490b46e970915b87ec1abf0b0a0c6c8c58ccf1fc16843');\nhashMap.set('pub','8e7c65dfd1999de4f7c44392e949a4d8f4701eb86df59d550e4657feb06b1872');\nhashMap.set('puppet','ba58ab689e44acc8f61c3569ab8b40fde01b8a9d3aad712708e2a419e57d8b45');\nhashMap.set('pyenv','9ede8becc97774f9040b40f4472d3e933534b596e04c360bfe0f3c6f95f25182');\nhashMap.set('quadlet','e1fc88a4e14cd595e89bb3d79b4adf2add3ce5eb80f75276e712c32598cca53d');\nhashMap.set('renovate-config','ca60beee2e3b871ea1216fa9df9a501f7ed355fe7da29e12509e56a124a78e69');\nhashMap.set('ruby-version','2db2140d9eee8c555e729a4de0396fa2d78846d3149890ee12fa515bd654be97');\nhashMap.set('runtime-version','b582b168c0cc595e39010feb10f4b97a82683eb269e9598216fbb11cc186e160');\nhashMap.set('rust-toolchain','6ace53db02874d73620d2d872291839820a512a9529c42d174358c692e5db720');\nhashMap.set('sbt','e1eb5c7f0171a9bb1b6bd4a36a91039a31b6c84e0983d91d930be31a69506d9e');\nhashMap.set('scalafmt','9d36159b56835e96498af026a1fb0543200db0581681ef95ec54988f411e180f');\nhashMap.set('setup-cfg','4a3a7c812d34739c07685691e7e64c7d3127f9d7d4aff99dc45a25df97ed9745');\nhashMap.set('smithy','9641b91d065ffb63be0dd888139a0402dba41e550f8b44c592db9daf52109100');\nhashMap.set('sveltos','60dd75bb53ace31217211100d622fdb65068c6162758b6ae7103a6ce8bdc9f90');\nhashMap.set('swift','5ebd875ee7a541b4725f6263789ea9a7c77a4b7c40b2119f894e67b588cfa672');\nhashMap.set('tekton','33948f5bdf7553909fa63744adb26da97ddf366e9499bccab1250879570267c9');\nhashMap.set('terraform','119a23583e7888eb362bfc0f9abd6c37feafbc1e21affb12c3d4d87e3734064f');\nhashMap.set('terraform-version','ec8f786b9731d47f2c2fe0307caf64d7ddd83046fe7ff1f7d8423239f8b0f2aa');\nhashMap.set('terragrunt','ffcbaa67dd65f064d43f8c121c1006115eab1879c4bd38de263b9b90a009c118');\nhashMap.set('terragrunt-version','eea6087b33717d22ede2fc68c2f64df8390b75abe82110ed831a180648feb51d');\nhashMap.set('tflint-plugin','31247d37bc80aae17039bfa21bd989c5717730c5ef10cf2a6f09841576d012ec');\nhashMap.set('travis','04c94f72622003195c8ea8147c8fbd93003f444ec807ce33f2ada2384282db83');\nhashMap.set('typst','d080a79fbd961c6e21fcc505d544b7e0ff2126142acb1dcabdf6abbcd9339248');\nhashMap.set('unity3d','f13e25e115e3443f4e16cf31578acffa78fb1a5e23339680a92d8d6de6052920');\nhashMap.set('velaci','fda00ddb7cc23e9a37e0a8a253151df0a6930b4276d3e4f78cc54b9ac09af7de');\nhashMap.set('vendir','7db907b3b77ef5f3465f3c4339fbab56bbcdfd1bf34b3d33e4c178d2e07e23e7');\nhashMap.set('woodpecker','6110d3bec33aaeb3511d4bbfa896cec3c8e02fb04a6cff50c9ba81061c851045');\nhashMap.set('xcodegen','dad511d88a9ce1dbdde8b9731f3da7f2bdaa4ca8a083294ee58d56da62ab1683');\nhashMap.set('jsonata','416bcf61144b276b3112814c6e6d261aa29608f46fbb0516c471d35c16f8f0d7');\nhashMap.set('regex','20be5247fdc164173871a051acb0527da017d0c155c653d7563601f55e7b3ff5');"],"mappings":";AAAA,MAAa,0BAAU,IAAI,IAAoB;AAE/C,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/F,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,QAAO,kEAAkE;AACrF,QAAQ,IAAI,mBAAkB,kEAAkE;AAChG,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/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AAkE;AAC3F,QAAQ,IAAI,YAAW,kEAAkE;AACzF,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,SAAQ,kEAAkE"}
|
|
@@ -266,6 +266,7 @@ function resolveResourceManifest(manifest, helmRepositories, registryAliases, co
|
|
|
266
266
|
}
|
|
267
267
|
case "Kustomization": for (const image of coerceArray(resource.spec.images)) {
|
|
268
268
|
const dep = extractImage(image, registryAliases);
|
|
269
|
+
// v8 ignore else -- the schema rejects an image without a name
|
|
269
270
|
if (dep) deps.push(dep);
|
|
270
271
|
}
|
|
271
272
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","names":[],"sources":["../../../../lib/modules/manager/flux/extract.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport {\n type Document,\n type Scalar,\n type YAMLMap,\n isMap,\n isPair,\n isScalar,\n parseAllDocuments,\n} from 'yaml';\nimport { logger } from '../../../logger/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { isHttpUrl } from '../../../util/url.ts';\nimport { parseYaml } from '../../../util/yaml.ts';\nimport { BitbucketTagsDatasource } from '../../datasource/bitbucket-tags/index.ts';\nimport { GitRefsDatasource } from '../../datasource/git-refs/index.ts';\nimport { GitTagsDatasource } from '../../datasource/git-tags/index.ts';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';\nimport { GithubTagsDatasource } from '../../datasource/github-tags/index.ts';\nimport { GitlabTagsDatasource } from '../../datasource/gitlab-tags/index.ts';\nimport { HelmDatasource } from '../../datasource/helm/index.ts';\nimport { getDep } from '../dockerfile/extract.ts';\nimport { findDependencies } from '../helm-values/extract.ts';\nimport {\n getOciChartDep,\n isOCIRegistry,\n removeOCIPrefix,\n} from '../helmv3/oci.ts';\nimport { extractImage } from '../kustomize/extract.ts';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFile,\n PackageFileContent,\n} from '../types.ts';\nimport {\n collectHelmRepos,\n isSystemManifest,\n systemManifestHeaderRegex,\n} from './common.ts';\nimport { FluxResource, type HelmRepository } from './schema.ts';\nimport type {\n FluxManagerData,\n FluxManifest,\n ResourceFluxManifest,\n SystemFluxManifest,\n} from './types.ts';\n\nfunction readManifest(\n content: string,\n packageFile: string,\n): FluxManifest | null {\n if (isSystemManifest(packageFile)) {\n const versionMatch = regEx(systemManifestHeaderRegex).exec(content);\n if (!versionMatch) {\n return null;\n }\n return {\n kind: 'system',\n file: packageFile,\n content,\n version: versionMatch[1],\n components: versionMatch[2],\n };\n }\n\n return {\n kind: 'resource',\n file: packageFile,\n content,\n resources: parseYaml(content, {\n customSchema: FluxResource,\n failureBehaviour: 'filter',\n removeTemplates: true,\n }),\n };\n}\n\nconst githubUrlRegex = regEx(\n /^(?:https:\\/\\/|git@)github\\.com[/:](?<packageName>[^/]+\\/[^/]+?)(?:\\.git)?$/,\n);\nconst gitlabUrlRegex = regEx(\n /^(?:https:\\/\\/|git@)gitlab\\.com[/:](?<packageName>[^/]+\\/[^/]+?)(?:\\.git)?$/,\n);\nconst bitbucketUrlRegex = regEx(\n /^(?:https:\\/\\/|git@)bitbucket\\.org[/:](?<packageName>[^/]+\\/[^/]+?)(?:\\.git)?$/,\n);\n\nfunction resolveGitRepositoryPerSourceTag(\n dep: PackageDependency,\n gitUrl: string,\n): void {\n const githubMatchGroups = githubUrlRegex.exec(gitUrl)?.groups;\n if (githubMatchGroups) {\n dep.datasource = GithubTagsDatasource.id;\n dep.packageName = githubMatchGroups.packageName;\n dep.sourceUrl = `https://github.com/${dep.packageName}`;\n return;\n }\n\n const gitlabMatchGroups = gitlabUrlRegex.exec(gitUrl)?.groups;\n if (gitlabMatchGroups) {\n dep.datasource = GitlabTagsDatasource.id;\n dep.packageName = gitlabMatchGroups.packageName;\n dep.sourceUrl = `https://gitlab.com/${dep.packageName}`;\n return;\n }\n\n const bitbucketMatchGroups = bitbucketUrlRegex.exec(gitUrl)?.groups;\n if (bitbucketMatchGroups) {\n dep.datasource = BitbucketTagsDatasource.id;\n dep.packageName = bitbucketMatchGroups.packageName;\n dep.sourceUrl = `https://bitbucket.org/${dep.packageName}`;\n return;\n }\n\n dep.datasource = GitTagsDatasource.id;\n dep.packageName = gitUrl;\n if (isHttpUrl(gitUrl)) {\n dep.sourceUrl = gitUrl.replace(regEx(/\\.git$/), '');\n }\n}\n\nfunction resolveHelmRepository(\n dep: PackageDependency,\n matchingRepositories: HelmRepository[],\n registryAliases: Record<string, string> | undefined,\n sourceRefName?: string,\n): void {\n if (matchingRepositories.length) {\n dep.registryUrls = matchingRepositories\n .map((repo) => {\n if (repo.spec.type === 'oci' || isOCIRegistry(repo.spec.url)) {\n Object.assign(\n dep,\n getOciChartDep(repo.spec.url, dep.depName, registryAliases),\n );\n return null;\n }\n return repo.spec.url;\n })\n .filter(isString);\n\n // if registryUrls is empty, delete it from dep\n if (!dep.registryUrls?.length) {\n delete dep.registryUrls;\n }\n return;\n }\n\n if (sourceRefName && registryAliases) {\n const aliasUrl = registryAliases[sourceRefName];\n if (aliasUrl) {\n if (isOCIRegistry(aliasUrl)) {\n // Treat alias value as an OCI registry URL\n Object.assign(\n dep,\n getOciChartDep(aliasUrl, dep.depName, registryAliases),\n );\n } else {\n dep.registryUrls = [aliasUrl];\n }\n return;\n }\n }\n\n dep.skipReason = 'unknown-registry';\n}\n\nfunction resolveSystemManifest(\n manifest: SystemFluxManifest,\n): PackageDependency<FluxManagerData>[] {\n return [\n {\n depName: 'fluxcd/flux2',\n datasource: GithubReleasesDatasource.id,\n currentValue: manifest.version,\n managerData: {\n components: manifest.components,\n },\n },\n ];\n}\n\n/**\n * Returns all `spec.ref` map nodes for OCIRepository resources matching `resourceName`.\n */\nfunction findOCIRefNodes(\n docs: Document.Parsed[],\n resourceName: string,\n): YAMLMap[] {\n const refNodes: YAMLMap[] = [];\n for (const doc of docs) {\n const docContents = doc.contents;\n if (!isMap(docContents)) {\n continue;\n }\n const kindNode = docContents.get('kind', true);\n if (\n !isScalar(kindNode) ||\n (kindNode.value as unknown) !== 'OCIRepository'\n ) {\n continue;\n }\n const nameNode = docContents.getIn(['metadata', 'name'], true);\n if (!isScalar(nameNode) || nameNode.value !== resourceName) {\n continue;\n }\n const specNode = docContents.get('spec');\n if (!isMap(specNode)) {\n continue;\n }\n const refNode = specNode.get('ref');\n if (isMap(refNode)) {\n refNodes.push(refNode);\n }\n }\n\n return refNodes;\n}\n\nfunction extractOCIRefTagAndDigestRange(\n docs: Document.Parsed[],\n content: string,\n resourceName: string,\n): { replaceString: string; tagFirst: boolean } | null {\n for (const refNode of findOCIRefNodes(docs, resourceName)) {\n let tagKey: Scalar | undefined;\n let tagValue: Scalar | undefined;\n let digestKey: Scalar | undefined;\n let digestValue: Scalar | undefined;\n\n for (const item of refNode.items) {\n if (!isPair(item) || !isScalar(item.key)) {\n continue;\n }\n if (item.key.value === 'tag' && isScalar(item.value)) {\n tagKey = item.key;\n tagValue = item.value;\n } else if (item.key.value === 'digest' && isScalar(item.value)) {\n digestKey = item.key;\n digestValue = item.value;\n }\n }\n\n if (\n !tagKey?.range ||\n !tagValue?.range ||\n !digestKey?.range ||\n !digestValue?.range\n ) {\n continue;\n }\n\n const tagFirst = tagKey.range[0] < digestKey.range[0];\n const start = tagFirst ? tagKey.range[0] : digestKey.range[0];\n const end = tagFirst ? digestValue.range[1] : tagValue.range[1];\n\n return { replaceString: content.slice(start, end), tagFirst };\n }\n\n return null;\n}\n\nfunction extractOCIRefTagRange(\n docs: Document.Parsed[],\n content: string,\n resourceName: string,\n): { replaceString: string; indentation: string } | null {\n for (const refNode of findOCIRefNodes(docs, resourceName)) {\n for (const item of refNode.items) {\n if (\n isPair(item) &&\n isScalar(item.key) &&\n item.key.value === 'tag' &&\n isScalar(item.value) &&\n item.key.range &&\n item.value.range\n ) {\n const keyStart = item.key.range[0];\n const valueEnd = item.value.range[1];\n const lineStart = content.lastIndexOf('\\n', keyStart - 1) + 1;\n return {\n replaceString: content.slice(keyStart, valueEnd),\n indentation: content.slice(lineStart, keyStart),\n };\n }\n }\n }\n\n return null;\n}\n\nfunction resolveResourceManifest(\n manifest: ResourceFluxManifest,\n helmRepositories: HelmRepository[],\n registryAliases: Record<string, string> | undefined,\n content: string,\n): PackageDependency[] {\n let docs: Document.Parsed[] | undefined;\n const deps: PackageDependency[] = [];\n for (const resource of manifest.resources) {\n switch (resource.kind) {\n case 'HelmRelease': {\n if (resource.spec.chartRef) {\n logger.trace(\n 'HelmRelease using chartRef was found, skipping as version will be handled via referenced resource directly',\n );\n } else if (resource.spec.chart) {\n const chartSpec = resource.spec.chart.spec;\n const depName = chartSpec.chart;\n const dep: PackageDependency = {\n depName,\n currentValue: resource.spec.chart.spec.version,\n datasource: HelmDatasource.id,\n };\n\n if (depName.startsWith('./')) {\n dep.skipReason = 'local-chart';\n delete dep.datasource;\n } else {\n const sourceRef = chartSpec.sourceRef;\n const matchingRepositories = helmRepositories.filter(\n (rep) =>\n rep.kind === sourceRef?.kind &&\n rep.metadata.name === sourceRef.name &&\n rep.metadata.namespace ===\n (sourceRef?.namespace ?? resource.metadata?.namespace),\n );\n resolveHelmRepository(\n dep,\n matchingRepositories,\n registryAliases,\n sourceRef?.name,\n );\n }\n deps.push(dep);\n } else {\n logger.debug(\n `invalid or incomplete ${resource.metadata.name} HelmRelease spec, skipping`,\n );\n }\n\n if (resource.spec.values) {\n logger.trace('detecting dependencies in HelmRelease values');\n deps.push(...findDependencies(resource.spec.values, registryAliases));\n }\n break;\n }\n\n case 'HelmChart': {\n if (resource.spec.sourceRef.kind === 'GitRepository') {\n logger.trace(\n 'HelmChart using GitRepository was found, skipping as version will be handled via referenced resource directly',\n );\n continue;\n }\n\n const dep: PackageDependency = {\n depName: resource.spec.chart,\n };\n\n if (resource.spec.sourceRef.kind === 'HelmRepository') {\n dep.currentValue = resource.spec.version;\n dep.datasource = HelmDatasource.id;\n\n const sourceRef = resource.spec.sourceRef;\n const matchingRepositories = helmRepositories.filter(\n (rep) =>\n rep.kind === sourceRef?.kind &&\n rep.metadata.name === sourceRef.name &&\n rep.metadata.namespace === resource.metadata?.namespace,\n );\n resolveHelmRepository(\n dep,\n matchingRepositories,\n registryAliases,\n sourceRef?.name,\n );\n } else {\n dep.skipReason = 'unsupported-datasource';\n }\n deps.push(dep);\n break;\n }\n\n case 'GitRepository': {\n const dep: PackageDependency = {\n depName: resource.metadata.name,\n };\n\n if (resource.spec.ref?.commit) {\n const gitUrl = resource.spec.url;\n dep.currentDigest = resource.spec.ref.commit;\n dep.datasource = GitRefsDatasource.id;\n dep.packageName = gitUrl;\n dep.replaceString = resource.spec.ref.commit;\n if (isHttpUrl(gitUrl)) {\n dep.sourceUrl = gitUrl.replace(regEx(/\\.git$/), '');\n }\n if (resource.spec.ref?.branch) {\n dep.currentValue = resource.spec.ref.branch;\n }\n } else if (resource.spec.ref?.tag) {\n dep.currentValue = resource.spec.ref.tag;\n resolveGitRepositoryPerSourceTag(dep, resource.spec.url);\n } else {\n dep.skipReason = 'unversioned-reference';\n }\n deps.push(dep);\n break;\n }\n case 'OCIRepository': {\n const container = removeOCIPrefix(resource.spec.url);\n if (resource.spec.ref?.digest && resource.spec.ref?.tag) {\n const combinedDep = getDep(\n `${container}@${resource.spec.ref.digest}`,\n false,\n registryAliases,\n );\n // Set currentValue to the tag so the docker datasource can look up the image's new digest\n combinedDep.currentValue = resource.spec.ref.tag;\n\n const refRange = extractOCIRefTagAndDigestRange(\n (docs ??= parseAllDocuments(content, { strict: false })),\n content,\n resource.metadata.name,\n );\n if (refRange) {\n combinedDep.replaceString = refRange.replaceString;\n if (refRange.tagFirst) {\n combinedDep.autoReplaceStringTemplate = refRange.replaceString\n .replace(resource.spec.ref.tag, '{{newValue}}')\n .replace(resource.spec.ref.digest, '{{newDigest}}');\n } else {\n combinedDep.autoReplaceStringTemplate = refRange.replaceString\n .replace(resource.spec.ref.digest, '{{newDigest}}')\n .replace(resource.spec.ref.tag, '{{newValue}}');\n }\n } else {\n logger.debug(\n { file: manifest.file, name: resource.metadata.name },\n 'Could not find tag/digest nodes in content, skipping replacement',\n );\n combinedDep.skipReason = 'invalid-value';\n }\n\n deps.push(combinedDep);\n } else if (resource.spec.ref?.digest) {\n const dep = getDep(\n `${container}@${resource.spec.ref.digest}`,\n false,\n registryAliases,\n );\n deps.push(dep);\n } else if (resource.spec.ref?.tag) {\n const dep = getDep(\n `${container}:${resource.spec.ref.tag}`,\n false,\n registryAliases,\n );\n const refTagRange = extractOCIRefTagRange(\n (docs ??= parseAllDocuments(content, { strict: false })),\n content,\n resource.metadata.name,\n );\n if (refTagRange) {\n dep.replaceString = refTagRange.replaceString;\n const newline = content.includes('\\r\\n') ? '\\r\\n' : '\\n';\n dep.autoReplaceStringTemplate = `${refTagRange.replaceString.replace(\n resource.spec.ref.tag,\n '{{newValue}}',\n )}{{#if newDigest}}${newline}${refTagRange.indentation}digest: {{newDigest}}{{/if}}`;\n } else {\n logger.debug(\n { file: manifest.file, name: resource.metadata.name },\n 'Unable to locate tag node for replacement (may be YAML alias or alias reference), digest pinning will not be possible',\n );\n dep.replaceString = resource.spec.ref.tag;\n dep.autoReplaceStringTemplate = '{{newValue}}';\n }\n deps.push(dep);\n } else {\n const dep = getDep(container, false, registryAliases);\n dep.skipReason = 'unversioned-reference';\n deps.push(dep);\n }\n break;\n }\n\n case 'Kustomization': {\n for (const image of coerceArray(resource.spec.images)) {\n const dep = extractImage(image, registryAliases);\n if (dep) {\n deps.push(dep);\n }\n }\n }\n }\n }\n return deps;\n}\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n config?: ExtractConfig,\n): PackageFileContent<FluxManagerData> | null {\n const manifest = readManifest(content, packageFile);\n if (!manifest) {\n return null;\n }\n const helmRepositories = collectHelmRepos([manifest]);\n let deps: PackageDependency[] | null = null;\n switch (manifest.kind) {\n case 'system':\n deps = resolveSystemManifest(manifest);\n break;\n case 'resource': {\n deps = resolveResourceManifest(\n manifest,\n helmRepositories,\n config?.registryAliases,\n content,\n );\n break;\n }\n }\n return deps?.length ? { deps } : null;\n}\n\nexport async function extractAllPackageFiles(\n config: ExtractConfig,\n packageFiles: string[],\n): Promise<PackageFile<FluxManagerData>[] | null> {\n const manifests: FluxManifest[] = [];\n const results: PackageFile<FluxManagerData>[] = [];\n\n for (const file of packageFiles) {\n const content = await readLocalFile(file, 'utf8');\n if (content) {\n const manifest = readManifest(content, file);\n if (manifest) {\n manifests.push(manifest);\n }\n }\n }\n\n const helmRepositories = collectHelmRepos(manifests);\n\n for (const manifest of manifests) {\n let deps: PackageDependency[] | null = null;\n switch (manifest.kind) {\n case 'system':\n deps = resolveSystemManifest(manifest);\n break;\n case 'resource': {\n deps = resolveResourceManifest(\n manifest,\n helmRepositories,\n config.registryAliases,\n manifest.content,\n );\n break;\n }\n }\n if (deps?.length) {\n results.push({\n packageFile: manifest.file,\n deps,\n });\n }\n }\n\n return results.length ? results : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAS,aACP,SACA,aACqB;CACrB,IAAI,iBAAiB,WAAW,GAAG;EACjC,MAAM,eAAe,MAAM,yBAAyB,CAAC,CAAC,KAAK,OAAO;EAClE,IAAI,CAAC,cACH,OAAO;EAET,OAAO;GACL,MAAM;GACN,MAAM;GACN;GACA,SAAS,aAAa;GACtB,YAAY,aAAa;EAC3B;CACF;CAEA,OAAO;EACL,MAAM;EACN,MAAM;EACN;EACA,WAAW,UAAU,SAAS;GAC5B,cAAc;GACd,kBAAkB;GAClB,iBAAiB;EACnB,CAAC;CACH;AACF;AAEA,MAAM,iBAAiB,MACrB,6EACF;AACA,MAAM,iBAAiB,MACrB,6EACF;AACA,MAAM,oBAAoB,MACxB,gFACF;AAEA,SAAS,iCACP,KACA,QACM;CACN,MAAM,oBAAoB,eAAe,KAAK,MAAM,CAAC,EAAE;CACvD,IAAI,mBAAmB;EACrB,IAAI,aAAa,qBAAqB;EACtC,IAAI,cAAc,kBAAkB;EACpC,IAAI,YAAY,sBAAsB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AmB,iBAAiB,SAAS;CAEnD,KAAK,MAAM,YAAY,WAAW;EAChC,IAAI,OAAmC;EACvC,QAAQ,SAAS,MAAjB;GACE,KAAK;IACH,OAAO,sBAAsB,QAAQ;IACrC;GACF,KAAK,YACH,OAAO,wBACL,UACA,kBACA,OAAO,iBACP,SAAS,OACX;EAGJ;EACA,IAAI,MAAM,QACR,QAAQ,KAAK;GACX,aAAa,SAAS;GACtB;EACF,CAAC;CAEL;CAEA,OAAO,QAAQ,SAAS,UAAU;AACpC"}
|
|
1
|
+
{"version":3,"file":"extract.js","names":[],"sources":["../../../../lib/modules/manager/flux/extract.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport {\n type Document,\n type Scalar,\n type YAMLMap,\n isMap,\n isPair,\n isScalar,\n parseAllDocuments,\n} from 'yaml';\nimport { logger } from '../../../logger/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { isHttpUrl } from '../../../util/url.ts';\nimport { parseYaml } from '../../../util/yaml.ts';\nimport { BitbucketTagsDatasource } from '../../datasource/bitbucket-tags/index.ts';\nimport { GitRefsDatasource } from '../../datasource/git-refs/index.ts';\nimport { GitTagsDatasource } from '../../datasource/git-tags/index.ts';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';\nimport { GithubTagsDatasource } from '../../datasource/github-tags/index.ts';\nimport { GitlabTagsDatasource } from '../../datasource/gitlab-tags/index.ts';\nimport { HelmDatasource } from '../../datasource/helm/index.ts';\nimport { getDep } from '../dockerfile/extract.ts';\nimport { findDependencies } from '../helm-values/extract.ts';\nimport {\n getOciChartDep,\n isOCIRegistry,\n removeOCIPrefix,\n} from '../helmv3/oci.ts';\nimport { extractImage } from '../kustomize/extract.ts';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFile,\n PackageFileContent,\n} from '../types.ts';\nimport {\n collectHelmRepos,\n isSystemManifest,\n systemManifestHeaderRegex,\n} from './common.ts';\nimport { FluxResource, type HelmRepository } from './schema.ts';\nimport type {\n FluxManagerData,\n FluxManifest,\n ResourceFluxManifest,\n SystemFluxManifest,\n} from './types.ts';\n\nfunction readManifest(\n content: string,\n packageFile: string,\n): FluxManifest | null {\n if (isSystemManifest(packageFile)) {\n const versionMatch = regEx(systemManifestHeaderRegex).exec(content);\n if (!versionMatch) {\n return null;\n }\n return {\n kind: 'system',\n file: packageFile,\n content,\n version: versionMatch[1],\n components: versionMatch[2],\n };\n }\n\n return {\n kind: 'resource',\n file: packageFile,\n content,\n resources: parseYaml(content, {\n customSchema: FluxResource,\n failureBehaviour: 'filter',\n removeTemplates: true,\n }),\n };\n}\n\nconst githubUrlRegex = regEx(\n /^(?:https:\\/\\/|git@)github\\.com[/:](?<packageName>[^/]+\\/[^/]+?)(?:\\.git)?$/,\n);\nconst gitlabUrlRegex = regEx(\n /^(?:https:\\/\\/|git@)gitlab\\.com[/:](?<packageName>[^/]+\\/[^/]+?)(?:\\.git)?$/,\n);\nconst bitbucketUrlRegex = regEx(\n /^(?:https:\\/\\/|git@)bitbucket\\.org[/:](?<packageName>[^/]+\\/[^/]+?)(?:\\.git)?$/,\n);\n\nfunction resolveGitRepositoryPerSourceTag(\n dep: PackageDependency,\n gitUrl: string,\n): void {\n const githubMatchGroups = githubUrlRegex.exec(gitUrl)?.groups;\n if (githubMatchGroups) {\n dep.datasource = GithubTagsDatasource.id;\n dep.packageName = githubMatchGroups.packageName;\n dep.sourceUrl = `https://github.com/${dep.packageName}`;\n return;\n }\n\n const gitlabMatchGroups = gitlabUrlRegex.exec(gitUrl)?.groups;\n if (gitlabMatchGroups) {\n dep.datasource = GitlabTagsDatasource.id;\n dep.packageName = gitlabMatchGroups.packageName;\n dep.sourceUrl = `https://gitlab.com/${dep.packageName}`;\n return;\n }\n\n const bitbucketMatchGroups = bitbucketUrlRegex.exec(gitUrl)?.groups;\n if (bitbucketMatchGroups) {\n dep.datasource = BitbucketTagsDatasource.id;\n dep.packageName = bitbucketMatchGroups.packageName;\n dep.sourceUrl = `https://bitbucket.org/${dep.packageName}`;\n return;\n }\n\n dep.datasource = GitTagsDatasource.id;\n dep.packageName = gitUrl;\n if (isHttpUrl(gitUrl)) {\n dep.sourceUrl = gitUrl.replace(regEx(/\\.git$/), '');\n }\n}\n\nfunction resolveHelmRepository(\n dep: PackageDependency,\n matchingRepositories: HelmRepository[],\n registryAliases: Record<string, string> | undefined,\n sourceRefName?: string,\n): void {\n if (matchingRepositories.length) {\n dep.registryUrls = matchingRepositories\n .map((repo) => {\n if (repo.spec.type === 'oci' || isOCIRegistry(repo.spec.url)) {\n Object.assign(\n dep,\n getOciChartDep(repo.spec.url, dep.depName, registryAliases),\n );\n return null;\n }\n return repo.spec.url;\n })\n .filter(isString);\n\n // if registryUrls is empty, delete it from dep\n if (!dep.registryUrls?.length) {\n delete dep.registryUrls;\n }\n return;\n }\n\n if (sourceRefName && registryAliases) {\n const aliasUrl = registryAliases[sourceRefName];\n if (aliasUrl) {\n if (isOCIRegistry(aliasUrl)) {\n // Treat alias value as an OCI registry URL\n Object.assign(\n dep,\n getOciChartDep(aliasUrl, dep.depName, registryAliases),\n );\n } else {\n dep.registryUrls = [aliasUrl];\n }\n return;\n }\n }\n\n dep.skipReason = 'unknown-registry';\n}\n\nfunction resolveSystemManifest(\n manifest: SystemFluxManifest,\n): PackageDependency<FluxManagerData>[] {\n return [\n {\n depName: 'fluxcd/flux2',\n datasource: GithubReleasesDatasource.id,\n currentValue: manifest.version,\n managerData: {\n components: manifest.components,\n },\n },\n ];\n}\n\n/**\n * Returns all `spec.ref` map nodes for OCIRepository resources matching `resourceName`.\n */\nfunction findOCIRefNodes(\n docs: Document.Parsed[],\n resourceName: string,\n): YAMLMap[] {\n const refNodes: YAMLMap[] = [];\n for (const doc of docs) {\n const docContents = doc.contents;\n if (!isMap(docContents)) {\n continue;\n }\n const kindNode = docContents.get('kind', true);\n if (\n !isScalar(kindNode) ||\n (kindNode.value as unknown) !== 'OCIRepository'\n ) {\n continue;\n }\n const nameNode = docContents.getIn(['metadata', 'name'], true);\n if (!isScalar(nameNode) || nameNode.value !== resourceName) {\n continue;\n }\n const specNode = docContents.get('spec');\n if (!isMap(specNode)) {\n continue;\n }\n const refNode = specNode.get('ref');\n if (isMap(refNode)) {\n refNodes.push(refNode);\n }\n }\n\n return refNodes;\n}\n\nfunction extractOCIRefTagAndDigestRange(\n docs: Document.Parsed[],\n content: string,\n resourceName: string,\n): { replaceString: string; tagFirst: boolean } | null {\n for (const refNode of findOCIRefNodes(docs, resourceName)) {\n let tagKey: Scalar | undefined;\n let tagValue: Scalar | undefined;\n let digestKey: Scalar | undefined;\n let digestValue: Scalar | undefined;\n\n for (const item of refNode.items) {\n if (!isPair(item) || !isScalar(item.key)) {\n continue;\n }\n if (item.key.value === 'tag' && isScalar(item.value)) {\n tagKey = item.key;\n tagValue = item.value;\n } else if (item.key.value === 'digest' && isScalar(item.value)) {\n digestKey = item.key;\n digestValue = item.value;\n }\n }\n\n if (\n !tagKey?.range ||\n !tagValue?.range ||\n !digestKey?.range ||\n !digestValue?.range\n ) {\n continue;\n }\n\n const tagFirst = tagKey.range[0] < digestKey.range[0];\n const start = tagFirst ? tagKey.range[0] : digestKey.range[0];\n const end = tagFirst ? digestValue.range[1] : tagValue.range[1];\n\n return { replaceString: content.slice(start, end), tagFirst };\n }\n\n return null;\n}\n\nfunction extractOCIRefTagRange(\n docs: Document.Parsed[],\n content: string,\n resourceName: string,\n): { replaceString: string; indentation: string } | null {\n for (const refNode of findOCIRefNodes(docs, resourceName)) {\n for (const item of refNode.items) {\n if (\n isPair(item) &&\n isScalar(item.key) &&\n item.key.value === 'tag' &&\n isScalar(item.value) &&\n item.key.range &&\n item.value.range\n ) {\n const keyStart = item.key.range[0];\n const valueEnd = item.value.range[1];\n const lineStart = content.lastIndexOf('\\n', keyStart - 1) + 1;\n return {\n replaceString: content.slice(keyStart, valueEnd),\n indentation: content.slice(lineStart, keyStart),\n };\n }\n }\n }\n\n return null;\n}\n\nfunction resolveResourceManifest(\n manifest: ResourceFluxManifest,\n helmRepositories: HelmRepository[],\n registryAliases: Record<string, string> | undefined,\n content: string,\n): PackageDependency[] {\n let docs: Document.Parsed[] | undefined;\n const deps: PackageDependency[] = [];\n for (const resource of manifest.resources) {\n switch (resource.kind) {\n case 'HelmRelease': {\n if (resource.spec.chartRef) {\n logger.trace(\n 'HelmRelease using chartRef was found, skipping as version will be handled via referenced resource directly',\n );\n } else if (resource.spec.chart) {\n const chartSpec = resource.spec.chart.spec;\n const depName = chartSpec.chart;\n const dep: PackageDependency = {\n depName,\n currentValue: resource.spec.chart.spec.version,\n datasource: HelmDatasource.id,\n };\n\n if (depName.startsWith('./')) {\n dep.skipReason = 'local-chart';\n delete dep.datasource;\n } else {\n const sourceRef = chartSpec.sourceRef;\n const matchingRepositories = helmRepositories.filter(\n (rep) =>\n rep.kind === sourceRef?.kind &&\n rep.metadata.name === sourceRef.name &&\n rep.metadata.namespace ===\n (sourceRef?.namespace ?? resource.metadata?.namespace),\n );\n resolveHelmRepository(\n dep,\n matchingRepositories,\n registryAliases,\n sourceRef?.name,\n );\n }\n deps.push(dep);\n } else {\n logger.debug(\n `invalid or incomplete ${resource.metadata.name} HelmRelease spec, skipping`,\n );\n }\n\n if (resource.spec.values) {\n logger.trace('detecting dependencies in HelmRelease values');\n deps.push(...findDependencies(resource.spec.values, registryAliases));\n }\n break;\n }\n\n case 'HelmChart': {\n if (resource.spec.sourceRef.kind === 'GitRepository') {\n logger.trace(\n 'HelmChart using GitRepository was found, skipping as version will be handled via referenced resource directly',\n );\n continue;\n }\n\n const dep: PackageDependency = {\n depName: resource.spec.chart,\n };\n\n if (resource.spec.sourceRef.kind === 'HelmRepository') {\n dep.currentValue = resource.spec.version;\n dep.datasource = HelmDatasource.id;\n\n const sourceRef = resource.spec.sourceRef;\n const matchingRepositories = helmRepositories.filter(\n (rep) =>\n rep.kind === sourceRef?.kind &&\n rep.metadata.name === sourceRef.name &&\n rep.metadata.namespace === resource.metadata?.namespace,\n );\n resolveHelmRepository(\n dep,\n matchingRepositories,\n registryAliases,\n sourceRef?.name,\n );\n } else {\n dep.skipReason = 'unsupported-datasource';\n }\n deps.push(dep);\n break;\n }\n\n case 'GitRepository': {\n const dep: PackageDependency = {\n depName: resource.metadata.name,\n };\n\n if (resource.spec.ref?.commit) {\n const gitUrl = resource.spec.url;\n dep.currentDigest = resource.spec.ref.commit;\n dep.datasource = GitRefsDatasource.id;\n dep.packageName = gitUrl;\n dep.replaceString = resource.spec.ref.commit;\n if (isHttpUrl(gitUrl)) {\n dep.sourceUrl = gitUrl.replace(regEx(/\\.git$/), '');\n }\n if (resource.spec.ref?.branch) {\n dep.currentValue = resource.spec.ref.branch;\n }\n } else if (resource.spec.ref?.tag) {\n dep.currentValue = resource.spec.ref.tag;\n resolveGitRepositoryPerSourceTag(dep, resource.spec.url);\n } else {\n dep.skipReason = 'unversioned-reference';\n }\n deps.push(dep);\n break;\n }\n case 'OCIRepository': {\n const container = removeOCIPrefix(resource.spec.url);\n if (resource.spec.ref?.digest && resource.spec.ref?.tag) {\n const combinedDep = getDep(\n `${container}@${resource.spec.ref.digest}`,\n false,\n registryAliases,\n );\n // Set currentValue to the tag so the docker datasource can look up the image's new digest\n combinedDep.currentValue = resource.spec.ref.tag;\n\n const refRange = extractOCIRefTagAndDigestRange(\n (docs ??= parseAllDocuments(content, { strict: false })),\n content,\n resource.metadata.name,\n );\n if (refRange) {\n combinedDep.replaceString = refRange.replaceString;\n if (refRange.tagFirst) {\n combinedDep.autoReplaceStringTemplate = refRange.replaceString\n .replace(resource.spec.ref.tag, '{{newValue}}')\n .replace(resource.spec.ref.digest, '{{newDigest}}');\n } else {\n combinedDep.autoReplaceStringTemplate = refRange.replaceString\n .replace(resource.spec.ref.digest, '{{newDigest}}')\n .replace(resource.spec.ref.tag, '{{newValue}}');\n }\n } else {\n logger.debug(\n { file: manifest.file, name: resource.metadata.name },\n 'Could not find tag/digest nodes in content, skipping replacement',\n );\n combinedDep.skipReason = 'invalid-value';\n }\n\n deps.push(combinedDep);\n } else if (resource.spec.ref?.digest) {\n const dep = getDep(\n `${container}@${resource.spec.ref.digest}`,\n false,\n registryAliases,\n );\n deps.push(dep);\n } else if (resource.spec.ref?.tag) {\n const dep = getDep(\n `${container}:${resource.spec.ref.tag}`,\n false,\n registryAliases,\n );\n const refTagRange = extractOCIRefTagRange(\n (docs ??= parseAllDocuments(content, { strict: false })),\n content,\n resource.metadata.name,\n );\n if (refTagRange) {\n dep.replaceString = refTagRange.replaceString;\n const newline = content.includes('\\r\\n') ? '\\r\\n' : '\\n';\n dep.autoReplaceStringTemplate = `${refTagRange.replaceString.replace(\n resource.spec.ref.tag,\n '{{newValue}}',\n )}{{#if newDigest}}${newline}${refTagRange.indentation}digest: {{newDigest}}{{/if}}`;\n } else {\n logger.debug(\n { file: manifest.file, name: resource.metadata.name },\n 'Unable to locate tag node for replacement (may be YAML alias or alias reference), digest pinning will not be possible',\n );\n dep.replaceString = resource.spec.ref.tag;\n dep.autoReplaceStringTemplate = '{{newValue}}';\n }\n deps.push(dep);\n } else {\n const dep = getDep(container, false, registryAliases);\n dep.skipReason = 'unversioned-reference';\n deps.push(dep);\n }\n break;\n }\n\n case 'Kustomization': {\n for (const image of coerceArray(resource.spec.images)) {\n const dep = extractImage(image, registryAliases);\n // v8 ignore else -- the schema rejects an image without a name\n if (dep) {\n deps.push(dep);\n }\n }\n }\n }\n }\n return deps;\n}\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n config?: ExtractConfig,\n): PackageFileContent<FluxManagerData> | null {\n const manifest = readManifest(content, packageFile);\n if (!manifest) {\n return null;\n }\n const helmRepositories = collectHelmRepos([manifest]);\n let deps: PackageDependency[] | null = null;\n switch (manifest.kind) {\n case 'system':\n deps = resolveSystemManifest(manifest);\n break;\n case 'resource': {\n deps = resolveResourceManifest(\n manifest,\n helmRepositories,\n config?.registryAliases,\n content,\n );\n break;\n }\n }\n return deps?.length ? { deps } : null;\n}\n\nexport async function extractAllPackageFiles(\n config: ExtractConfig,\n packageFiles: string[],\n): Promise<PackageFile<FluxManagerData>[] | null> {\n const manifests: FluxManifest[] = [];\n const results: PackageFile<FluxManagerData>[] = [];\n\n for (const file of packageFiles) {\n const content = await readLocalFile(file, 'utf8');\n if (content) {\n const manifest = readManifest(content, file);\n if (manifest) {\n manifests.push(manifest);\n }\n }\n }\n\n const helmRepositories = collectHelmRepos(manifests);\n\n for (const manifest of manifests) {\n let deps: PackageDependency[] | null = null;\n switch (manifest.kind) {\n case 'system':\n deps = resolveSystemManifest(manifest);\n break;\n case 'resource': {\n deps = resolveResourceManifest(\n manifest,\n helmRepositories,\n config.registryAliases,\n manifest.content,\n );\n break;\n }\n }\n if (deps?.length) {\n results.push({\n packageFile: manifest.file,\n deps,\n });\n }\n }\n\n return results.length ? results : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAS,aACP,SACA,aACqB;CACrB,IAAI,iBAAiB,WAAW,GAAG;EACjC,MAAM,eAAe,MAAM,yBAAyB,CAAC,CAAC,KAAK,OAAO;EAClE,IAAI,CAAC,cACH,OAAO;EAET,OAAO;GACL,MAAM;GACN,MAAM;GACN;GACA,SAAS,aAAa;GACtB,YAAY,aAAa;EAC3B;CACF;CAEA,OAAO;EACL,MAAM;EACN,MAAM;EACN;EACA,WAAW,UAAU,SAAS;GAC5B,cAAc;GACd,kBAAkB;GAClB,iBAAiB;EACnB,CAAC;CACH;AACF;AAEA,MAAM,iBAAiB,MACrB,6EACF;AACA,MAAM,iBAAiB,MACrB,6EACF;AACA,MAAM,oBAAoB,MACxB,gFACF;AAEA,SAAS,iCACP,KACA,QACM;CACN,MAAM,oBAAoB,eAAe,KAAK,MAAM,CAAC,EAAE;CACvD,IAAI,mBAAmB;EACrB,IAAI,aAAa,qBAAqB;EACtC,IAAI,cAAc,kBAAkB;EACpC,IAAI,YAAY,sBAAsB,IAAI;EAC1C;CACF;CAEA,MAAM,oBAAoB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,YAAY,WAAW;EAChC,IAAI,OAAmC;EACvC,QAAQ,SAAS,MAAjB;GACE,KAAK;IACH,OAAO,sBAAsB,QAAQ;IACrC;GACF,KAAK,YACH,OAAO,wBACL,UACA,kBACA,OAAO,iBACP,SAAS,OACX;EAGJ;EACA,IAAI,MAAM,QACR,QAAQ,KAAK;GACX,aAAa,SAAS;GACtB;EACF,CAAC;CAEL;CAEA,OAAO,QAAQ,SAAS,UAAU;AACpC"}
|
|
@@ -98,6 +98,7 @@ function extractWithRegex(content, config) {
|
|
|
98
98
|
deps.push(extractDockerAction(actionRef, config));
|
|
99
99
|
continue;
|
|
100
100
|
}
|
|
101
|
+
// v8 ignore else -- the parsed ref is either a docker or a repository ref
|
|
101
102
|
if (actionRef.kind === "repository") deps.push(extractRepositoryAction(actionRef, parsed, customRegistryUrlsPackageDependency));
|
|
102
103
|
}
|
|
103
104
|
return deps;
|
|
@@ -151,6 +152,7 @@ function extractWithYAMLParser(content, packageFile, config) {
|
|
|
151
152
|
for (const job of Object.values(obj.jobs)) {
|
|
152
153
|
if (job.container) {
|
|
153
154
|
const dep = getDep(job.container, true, config.registryAliases);
|
|
155
|
+
// v8 ignore else -- `getDep()` always returns a dep
|
|
154
156
|
if (dep) {
|
|
155
157
|
dep.depType = "container";
|
|
156
158
|
deps.push(dep);
|
|
@@ -158,6 +160,7 @@ function extractWithYAMLParser(content, packageFile, config) {
|
|
|
158
160
|
}
|
|
159
161
|
for (const service of job.services) {
|
|
160
162
|
const dep = getDep(service, true, config.registryAliases);
|
|
163
|
+
// v8 ignore else -- `getDep()` always returns a dep
|
|
161
164
|
if (dep) {
|
|
162
165
|
dep.depType = "service";
|
|
163
166
|
deps.push(dep);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","names":["githubActionsVersioning.id","exactVersioning.id","memCache.get"],"sources":["../../../../lib/modules/manager/github-actions/extract.ts"],"sourcesContent":["import is from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../config/global.ts';\nimport { logger, withMeta } from '../../../logger/index.ts';\nimport * as memCache from '../../../util/cache/memory/index.ts';\nimport { detectPlatform } from '../../../util/common.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { newlineRegex, regEx } from '../../../util/regex.ts';\nimport { parseUrl } from '../../../util/url.ts';\nimport { ForgejoTagsDatasource } from '../../datasource/forgejo-tags/index.ts';\nimport { GiteaTagsDatasource } from '../../datasource/gitea-tags/index.ts';\nimport { GithubDigestDatasource } from '../../datasource/github-digest/index.ts';\nimport { GithubRunnersDatasource } from '../../datasource/github-runners/index.ts';\nimport { GithubTagsDatasource } from '../../datasource/github-tags/index.ts';\nimport * as dockerVersioning from '../../versioning/docker/index.ts';\nimport * as exactVersioning from '../../versioning/exact/index.ts';\nimport * as githubActionsVersioning from '../../versioning/github-actions/index.ts';\nimport { getDep } from '../dockerfile/extract.ts';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFileContent,\n} from '../types.ts';\nimport { actionsLockFile, isLockfileManaged } from './common.ts';\nimport { isSha, isShortSha, parseUsesLine, versionLikeRe } from './parse.ts';\nimport type { UsesStep } from './schema.ts';\nimport { ActionsLockfile, CommunityActions, Workflow } from './schema.ts';\nimport type {\n DockerReference,\n LockfileState,\n RepositoryReference,\n} from './types.ts';\n\n// detects if we run against a Github Enterprise Server and adds the URL to the beginning of the registryURLs for looking up Actions\n// This reflects the behavior of how GitHub looks up Actions\n// First on the Enterprise Server, then on GitHub.com\nfunction detectCustomGitHubRegistryUrlsForActions(): PackageDependency {\n const endpoint = GlobalConfig.get('endpoint');\n const registryUrls = ['https://github.com'];\n if (endpoint && GlobalConfig.get('platform') === 'github') {\n const parsedEndpoint = parseUrl(endpoint);\n if (!parsedEndpoint) {\n logger.warn({ endpoint }, 'Failed to parse endpoint url');\n return {};\n }\n\n if (\n parsedEndpoint.host !== 'github.com' &&\n parsedEndpoint.host !== 'api.github.com'\n ) {\n registryUrls.unshift(\n `${parsedEndpoint.protocol}//${parsedEndpoint.host}`,\n );\n return { registryUrls };\n }\n }\n return {};\n}\n\nfunction extractDockerAction(\n actionRef: DockerReference,\n config: ExtractConfig,\n): PackageDependency {\n const dep = getDep(actionRef.originalRef, true, config.registryAliases);\n dep.depType = 'docker';\n dep.replaceString = actionRef.originalRef;\n return dep;\n}\n\nconst reusableWorkflowPathRe = regEx(/^\\.github\\/workflows\\/[^/]+\\.ya?ml$/);\n\nfunction extractRepositoryAction(\n actionRef: RepositoryReference,\n parsed: ReturnType<typeof parseUsesLine> & object,\n customRegistryUrlsPackageDependency: PackageDependency,\n): PackageDependency {\n const {\n replaceString: valueString,\n quote,\n commentData,\n commentPrecedingWhitespace,\n } = parsed;\n const {\n owner,\n repo,\n path: subPath,\n ref,\n hostname,\n isExplicitHostname,\n } = actionRef;\n\n const registryUrl = isExplicitHostname ? `https://${hostname}/` : '';\n const packageName = `${owner}/${repo}`;\n const depName = `${registryUrl}${packageName}`;\n const pathSuffix = subPath ? `/${subPath}` : '';\n const commentWs = commentPrecedingWhitespace || ' ';\n const isReusableWorkflow = !!subPath && reusableWorkflowPathRe.test(subPath);\n\n const dep: PackageDependency = {\n depName,\n commitMessageTopic: '{{{depName}}} action',\n versioning: githubActionsVersioning.id,\n depType: isReusableWorkflow ? 'workflow' : 'action',\n replaceString: valueString,\n autoReplaceStringTemplate: `${quote}{{depName}}${pathSuffix}@{{#if newDigest}}{{newDigest}}${quote}{{#if newValue}}${commentWs}# {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}${quote}{{/unless}}`,\n ...(isExplicitHostname\n ? detectDatasource(registryUrl)\n : customRegistryUrlsPackageDependency),\n };\n\n if (packageName !== depName) {\n dep.packageName = packageName;\n }\n\n // Extend replaceString to include relevant comment portions:\n // - Pinned version or ref: include only up to the matched token (truncate trailing text)\n // - Ratchet exclude: include the full comment to preserve the marker\n const pinComment =\n commentData.pinnedVersion ??\n (isSha(ref) || isShortSha(ref) ? commentData.ref : undefined);\n if (\n pinComment &&\n !is.undefined(commentData.index) &&\n !is.undefined(commentData.matchedString)\n ) {\n const cleanComment = parsed.commentString.slice(1);\n const matchEndIndex = commentData.index + commentData.matchedString.length;\n const commentSuffix = cleanComment.slice(0, matchEndIndex);\n dep.replaceString = `${valueString}${commentPrecedingWhitespace}#${commentSuffix}`;\n } else if (commentData.ratchetExclude) {\n dep.replaceString =\n valueString + commentPrecedingWhitespace + parsed.commentString;\n }\n\n if (isSha(ref)) {\n dep.currentValue = commentData.pinnedVersion ?? commentData.ref;\n dep.currentDigest = ref;\n } else if (isShortSha(ref)) {\n dep.currentValue = commentData.pinnedVersion ?? commentData.ref;\n dep.currentDigestShort = ref;\n } else {\n dep.currentValue = ref;\n }\n\n if (!dep.currentValue) {\n dep.enabled = false;\n dep.skipReason = 'unversioned-reference';\n }\n\n const isVersionLike =\n dep.currentValue && versionLikeRe.test(dep.currentValue);\n if (!dep.datasource && dep.currentValue && !isVersionLike) {\n dep.datasource = GithubDigestDatasource.id;\n dep.versioning = exactVersioning.id;\n }\n\n dep.datasource ??= GithubTagsDatasource.id;\n\n return dep;\n}\n\nfunction extractWithRegex(\n content: string,\n config: ExtractConfig,\n): PackageDependency[] {\n const customRegistryUrlsPackageDependency =\n detectCustomGitHubRegistryUrlsForActions();\n logger.trace('github-actions.extractWithRegex()');\n const deps: PackageDependency[] = [];\n\n for (const line of content.split(newlineRegex)) {\n if (line.trim().startsWith('#')) {\n continue;\n }\n\n const parsed = parseUsesLine(line);\n if (!parsed?.actionRef) {\n continue;\n }\n\n const { actionRef } = parsed;\n\n if (actionRef.kind === 'docker') {\n deps.push(extractDockerAction(actionRef, config));\n continue;\n }\n\n if (actionRef.kind === 'repository') {\n deps.push(\n extractRepositoryAction(\n actionRef,\n parsed,\n customRegistryUrlsPackageDependency,\n ),\n );\n }\n }\n\n return deps;\n}\n\nfunction detectDatasource(registryUrl: string): PackageDependency {\n const platform = detectPlatform(registryUrl);\n\n switch (platform) {\n case 'forgejo':\n return {\n registryUrls: [registryUrl],\n datasource: ForgejoTagsDatasource.id,\n };\n case 'gitea':\n return {\n registryUrls: [registryUrl],\n datasource: GiteaTagsDatasource.id,\n };\n case 'github':\n return { registryUrls: [registryUrl] };\n }\n\n return {\n skipReason: 'unsupported-url',\n };\n}\n\nconst runnerVersionRegex = regEx(\n /^\\s*(?<depName>[a-zA-Z]+)-(?<currentValue>[^\\s]+)/,\n);\n\nfunction extractRunner(runner: string): PackageDependency | null {\n const runnerVersionGroups = runnerVersionRegex.exec(runner)?.groups;\n if (!runnerVersionGroups) {\n return null;\n }\n\n const { depName, currentValue } = runnerVersionGroups;\n\n if (!GithubRunnersDatasource.isValidRunner(depName, currentValue)) {\n return null;\n }\n\n const dependency: PackageDependency = {\n depName,\n currentValue,\n replaceString: `${depName}-${currentValue}`,\n depType: 'github-runner',\n datasource: GithubRunnersDatasource.id,\n autoReplaceStringTemplate: '{{depName}}-{{newValue}}',\n };\n\n if (!dockerVersioning.api.isValid(currentValue)) {\n dependency.skipReason = 'invalid-version';\n }\n\n return dependency;\n}\n\nfunction extractSteps(steps: UsesStep[]): PackageDependency[] {\n const deps: PackageDependency[] = [];\n\n for (const step of steps) {\n const res = CommunityActions.safeParse(step);\n if (res.success) {\n deps.push(...res.data);\n }\n }\n\n return deps;\n}\n\nfunction extractWithYAMLParser(\n content: string,\n packageFile: string,\n config: ExtractConfig,\n): PackageDependency[] {\n logger.trace('github-actions.extractWithYAMLParser()');\n\n const obj = withMeta({ packageFile }, () => Workflow.parse(content));\n if (!obj) {\n return [];\n }\n\n if ('runs' in obj && obj.runs.steps) {\n return extractSteps(obj.runs.steps);\n }\n\n if (!('jobs' in obj)) {\n return [];\n }\n\n const deps: PackageDependency[] = [];\n\n for (const job of Object.values(obj.jobs)) {\n if (job.container) {\n const dep = getDep(job.container, true, config.registryAliases);\n if (dep) {\n dep.depType = 'container';\n deps.push(dep);\n }\n }\n\n for (const service of job.services) {\n const dep = getDep(service, true, config.registryAliases);\n if (dep) {\n dep.depType = 'service';\n deps.push(dep);\n }\n }\n\n for (const runner of job['runs-on']) {\n const dep = extractRunner(runner);\n if (dep) {\n deps.push(dep);\n }\n }\n\n deps.push(...extractSteps(job.steps));\n }\n\n return deps;\n}\n\nasync function readLockfile(): Promise<LockfileState> {\n const content = await readLocalFile(actionsLockFile, 'utf8');\n if (!content) {\n return { type: 'missing' };\n }\n\n const parsed = ActionsLockfile.safeParse(content);\n if (!parsed.success) {\n // `updateActionsLockfile` warns about this once per branch, so stay quiet\n logger.debug(`Failed to parse ${actionsLockFile}`);\n return { type: 'unparseable' };\n }\n\n return { type: 'parsed', onboardedWorkflows: parsed.data.workflows };\n}\n\n/**\n * A repository has a single lock file, but can have any number of package files, so read and parse it only once.\n */\nfunction getLockfile(): Promise<LockfileState> {\n const cacheKey = `github-actions:${actionsLockFile}`;\n const cached = memCache.get<Promise<LockfileState> | undefined>(cacheKey);\n if (cached !== undefined) {\n return cached;\n }\n\n const result = readLockfile();\n memCache.set(cacheKey, result);\n return result;\n}\n\n/**\n * Whether `gh actions-lock` owns the digests in this file.\n *\n * It rewrites the workflows it manages back to plain refs when regenerating, so an inline digest pin would be stripped straight back out.\n */\nasync function isManagedByLockfile(packageFile: string): Promise<boolean> {\n const lockfile = await getLockfile();\n\n switch (lockfile.type) {\n case 'missing':\n return false;\n case 'unparseable':\n // The tool refuses to regenerate a lock file which it cannot parse, so treat everything as managed: pinning inline here would raise a PR which pins the digests the tool owns and leaves the lock file stale.\n return true;\n case 'parsed':\n return isLockfileManaged(packageFile, lockfile.onboardedWorkflows);\n }\n}\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n config: ExtractConfig = {}, // TODO: enforce ExtractConfig\n): Promise<PackageFileContent | null> {\n logger.trace(`github-actions.extractPackageFile(${packageFile})`);\n\n const deps = [\n ...extractWithRegex(content, config),\n ...extractWithYAMLParser(content, packageFile, config),\n ];\n\n if (!deps.length) {\n return null;\n }\n\n const res: PackageFileContent = { deps };\n\n if (await isManagedByLockfile(packageFile)) {\n // Deliberately no `lockFiles`: nothing here goes through `updateArtifacts`, and `matchFileNames` also tests `lockFiles`, so declaring it would make a negated rule such as `!.github/workflows/release.yml` match every workflow through the lock file path.\n for (const dep of deps) {\n // The lock file only records `OWNER/REPO@REF` pins, so a `docker://` image in a `uses:` is still ours to pin.\n if (dep.depType === 'action' || dep.depType === 'workflow') {\n dep.digestManagedExternally = true;\n }\n }\n }\n\n return res;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmCA,SAAS,2CAA8D;CACrE,MAAM,WAAW,aAAa,IAAI,UAAU;CAC5C,MAAM,eAAe,CAAC,oBAAoB;CAC1C,IAAI,YAAY,aAAa,IAAI,UAAU,MAAM,UAAU;EACzD,MAAM,iBAAiB,SAAS,QAAQ;EACxC,IAAI,CAAC,gBAAgB;GACnB,OAAO,KAAK,EAAE,SAAS,GAAG,8BAA8B;GACxD,OAAO,CAAC;EACV;EAEA,IACE,eAAe,SAAS,gBACxB,eAAe,SAAS,kBACxB;GACA,aAAa,QACX,GAAG,eAAe,SAAS,IAAI,eAAe,MAChD;GACA,OAAO,EAAE,aAAa;EACxB;CACF;CACA,OAAO,CAAC;AACV;AAEA,SAAS,oBACP,WACA,QACmB;CACnB,MAAM,MAAM,OAAO,UAAU,aAAa,MAAM,OAAO,eAAe;CACtE,IAAI,UAAU;CACd,IAAI,gBAAgB,UAAU;CAC9B,OAAO;AACT;AAEA,MAAM,yBAAyB,MAAM,qCAAqC;AAE1E,SAAS,wBACP,WACA,QACA,qCACmB;CACnB,MAAM,EACJ,eAAe,aACf,OACA,aACA,+BACE;CACJ,MAAM,EACJ,OACA,MACA,MAAM,SACN,KACA,UACA,uBACE;CAEJ,MAAM,cAAc,qBAAqB,WAAW,SAAS,KAAK;CAClE,MAAM,cAAc,GAAG,MAAM,GAAG;CAChC,MAAM,UAAU,GAAG,cAAc;CACjC,MAAM,aAAa,UAAU,IAAI,YAAY;CAC7C,MAAM,YAAY,8BAA8B;CAChD,MAAM,qBAAqB,CAAC,CAA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AO,KAAK;CAAU;AACrE;;;;AAKA,SAAS,cAAsC;CAC7C,MAAM,WAAW,kBAAkB;CACnC,MAAM,SAASC,IAAiD,QAAQ;CACxE,IAAI,WAAW,KAAA,GACb,OAAO;CAGT,MAAM,SAAS,aAAa;CAC5B,IAAa,UAAU,MAAM;CAC7B,OAAO;AACT;;;;;;AAOA,eAAe,oBAAoB,aAAuC;CACxE,MAAM,WAAW,MAAM,YAAY;CAEnC,QAAQ,SAAS,MAAjB;EACE,KAAK,WACH,OAAO;EACT,KAAK,eAEH,OAAO;EACT,KAAK,UACH,OAAO,kBAAkB,aAAa,SAAS,kBAAkB;CACrE;AACF;AAEA,eAAsB,mBACpB,SACA,aACA,SAAwB,CAAC,GACW;CACpC,OAAO,MAAM,qCAAqC,YAAY,EAAE;CAEhE,MAAM,OAAO,CACX,GAAG,iBAAiB,SAAS,MAAM,GACnC,GAAG,sBAAsB,SAAS,aAAa,MAAM,CACvD;CAEA,IAAI,CAAC,KAAK,QACR,OAAO;CAGT,MAAM,MAA0B,EAAE,KAAK;CAEvC,IAAI,MAAM,oBAAoB,WAAW,GAElC;OAAA,MAAM,OAAO,MAEhB,IAAI,IAAI,YAAY,YAAY,IAAI,YAAY,YAC9C,IAAI,0BAA0B;CAAA;CAKpC,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"extract.js","names":["githubActionsVersioning.id","exactVersioning.id","memCache.get"],"sources":["../../../../lib/modules/manager/github-actions/extract.ts"],"sourcesContent":["import is from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../config/global.ts';\nimport { logger, withMeta } from '../../../logger/index.ts';\nimport * as memCache from '../../../util/cache/memory/index.ts';\nimport { detectPlatform } from '../../../util/common.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { newlineRegex, regEx } from '../../../util/regex.ts';\nimport { parseUrl } from '../../../util/url.ts';\nimport { ForgejoTagsDatasource } from '../../datasource/forgejo-tags/index.ts';\nimport { GiteaTagsDatasource } from '../../datasource/gitea-tags/index.ts';\nimport { GithubDigestDatasource } from '../../datasource/github-digest/index.ts';\nimport { GithubRunnersDatasource } from '../../datasource/github-runners/index.ts';\nimport { GithubTagsDatasource } from '../../datasource/github-tags/index.ts';\nimport * as dockerVersioning from '../../versioning/docker/index.ts';\nimport * as exactVersioning from '../../versioning/exact/index.ts';\nimport * as githubActionsVersioning from '../../versioning/github-actions/index.ts';\nimport { getDep } from '../dockerfile/extract.ts';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFileContent,\n} from '../types.ts';\nimport { actionsLockFile, isLockfileManaged } from './common.ts';\nimport { isSha, isShortSha, parseUsesLine, versionLikeRe } from './parse.ts';\nimport type { UsesStep } from './schema.ts';\nimport { ActionsLockfile, CommunityActions, Workflow } from './schema.ts';\nimport type {\n DockerReference,\n LockfileState,\n RepositoryReference,\n} from './types.ts';\n\n// detects if we run against a Github Enterprise Server and adds the URL to the beginning of the registryURLs for looking up Actions\n// This reflects the behavior of how GitHub looks up Actions\n// First on the Enterprise Server, then on GitHub.com\nfunction detectCustomGitHubRegistryUrlsForActions(): PackageDependency {\n const endpoint = GlobalConfig.get('endpoint');\n const registryUrls = ['https://github.com'];\n if (endpoint && GlobalConfig.get('platform') === 'github') {\n const parsedEndpoint = parseUrl(endpoint);\n if (!parsedEndpoint) {\n logger.warn({ endpoint }, 'Failed to parse endpoint url');\n return {};\n }\n\n if (\n parsedEndpoint.host !== 'github.com' &&\n parsedEndpoint.host !== 'api.github.com'\n ) {\n registryUrls.unshift(\n `${parsedEndpoint.protocol}//${parsedEndpoint.host}`,\n );\n return { registryUrls };\n }\n }\n return {};\n}\n\nfunction extractDockerAction(\n actionRef: DockerReference,\n config: ExtractConfig,\n): PackageDependency {\n const dep = getDep(actionRef.originalRef, true, config.registryAliases);\n dep.depType = 'docker';\n dep.replaceString = actionRef.originalRef;\n return dep;\n}\n\nconst reusableWorkflowPathRe = regEx(/^\\.github\\/workflows\\/[^/]+\\.ya?ml$/);\n\nfunction extractRepositoryAction(\n actionRef: RepositoryReference,\n parsed: ReturnType<typeof parseUsesLine> & object,\n customRegistryUrlsPackageDependency: PackageDependency,\n): PackageDependency {\n const {\n replaceString: valueString,\n quote,\n commentData,\n commentPrecedingWhitespace,\n } = parsed;\n const {\n owner,\n repo,\n path: subPath,\n ref,\n hostname,\n isExplicitHostname,\n } = actionRef;\n\n const registryUrl = isExplicitHostname ? `https://${hostname}/` : '';\n const packageName = `${owner}/${repo}`;\n const depName = `${registryUrl}${packageName}`;\n const pathSuffix = subPath ? `/${subPath}` : '';\n const commentWs = commentPrecedingWhitespace || ' ';\n const isReusableWorkflow = !!subPath && reusableWorkflowPathRe.test(subPath);\n\n const dep: PackageDependency = {\n depName,\n commitMessageTopic: '{{{depName}}} action',\n versioning: githubActionsVersioning.id,\n depType: isReusableWorkflow ? 'workflow' : 'action',\n replaceString: valueString,\n autoReplaceStringTemplate: `${quote}{{depName}}${pathSuffix}@{{#if newDigest}}{{newDigest}}${quote}{{#if newValue}}${commentWs}# {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}${quote}{{/unless}}`,\n ...(isExplicitHostname\n ? detectDatasource(registryUrl)\n : customRegistryUrlsPackageDependency),\n };\n\n if (packageName !== depName) {\n dep.packageName = packageName;\n }\n\n // Extend replaceString to include relevant comment portions:\n // - Pinned version or ref: include only up to the matched token (truncate trailing text)\n // - Ratchet exclude: include the full comment to preserve the marker\n const pinComment =\n commentData.pinnedVersion ??\n (isSha(ref) || isShortSha(ref) ? commentData.ref : undefined);\n if (\n pinComment &&\n !is.undefined(commentData.index) &&\n !is.undefined(commentData.matchedString)\n ) {\n const cleanComment = parsed.commentString.slice(1);\n const matchEndIndex = commentData.index + commentData.matchedString.length;\n const commentSuffix = cleanComment.slice(0, matchEndIndex);\n dep.replaceString = `${valueString}${commentPrecedingWhitespace}#${commentSuffix}`;\n } else if (commentData.ratchetExclude) {\n dep.replaceString =\n valueString + commentPrecedingWhitespace + parsed.commentString;\n }\n\n if (isSha(ref)) {\n dep.currentValue = commentData.pinnedVersion ?? commentData.ref;\n dep.currentDigest = ref;\n } else if (isShortSha(ref)) {\n dep.currentValue = commentData.pinnedVersion ?? commentData.ref;\n dep.currentDigestShort = ref;\n } else {\n dep.currentValue = ref;\n }\n\n if (!dep.currentValue) {\n dep.enabled = false;\n dep.skipReason = 'unversioned-reference';\n }\n\n const isVersionLike =\n dep.currentValue && versionLikeRe.test(dep.currentValue);\n if (!dep.datasource && dep.currentValue && !isVersionLike) {\n dep.datasource = GithubDigestDatasource.id;\n dep.versioning = exactVersioning.id;\n }\n\n dep.datasource ??= GithubTagsDatasource.id;\n\n return dep;\n}\n\nfunction extractWithRegex(\n content: string,\n config: ExtractConfig,\n): PackageDependency[] {\n const customRegistryUrlsPackageDependency =\n detectCustomGitHubRegistryUrlsForActions();\n logger.trace('github-actions.extractWithRegex()');\n const deps: PackageDependency[] = [];\n\n for (const line of content.split(newlineRegex)) {\n if (line.trim().startsWith('#')) {\n continue;\n }\n\n const parsed = parseUsesLine(line);\n if (!parsed?.actionRef) {\n continue;\n }\n\n const { actionRef } = parsed;\n\n if (actionRef.kind === 'docker') {\n deps.push(extractDockerAction(actionRef, config));\n continue;\n }\n\n // v8 ignore else -- the parsed ref is either a docker or a repository ref\n if (actionRef.kind === 'repository') {\n deps.push(\n extractRepositoryAction(\n actionRef,\n parsed,\n customRegistryUrlsPackageDependency,\n ),\n );\n }\n }\n\n return deps;\n}\n\nfunction detectDatasource(registryUrl: string): PackageDependency {\n const platform = detectPlatform(registryUrl);\n\n switch (platform) {\n case 'forgejo':\n return {\n registryUrls: [registryUrl],\n datasource: ForgejoTagsDatasource.id,\n };\n case 'gitea':\n return {\n registryUrls: [registryUrl],\n datasource: GiteaTagsDatasource.id,\n };\n case 'github':\n return { registryUrls: [registryUrl] };\n }\n\n return {\n skipReason: 'unsupported-url',\n };\n}\n\nconst runnerVersionRegex = regEx(\n /^\\s*(?<depName>[a-zA-Z]+)-(?<currentValue>[^\\s]+)/,\n);\n\nfunction extractRunner(runner: string): PackageDependency | null {\n const runnerVersionGroups = runnerVersionRegex.exec(runner)?.groups;\n if (!runnerVersionGroups) {\n return null;\n }\n\n const { depName, currentValue } = runnerVersionGroups;\n\n if (!GithubRunnersDatasource.isValidRunner(depName, currentValue)) {\n return null;\n }\n\n const dependency: PackageDependency = {\n depName,\n currentValue,\n replaceString: `${depName}-${currentValue}`,\n depType: 'github-runner',\n datasource: GithubRunnersDatasource.id,\n autoReplaceStringTemplate: '{{depName}}-{{newValue}}',\n };\n\n if (!dockerVersioning.api.isValid(currentValue)) {\n dependency.skipReason = 'invalid-version';\n }\n\n return dependency;\n}\n\nfunction extractSteps(steps: UsesStep[]): PackageDependency[] {\n const deps: PackageDependency[] = [];\n\n for (const step of steps) {\n const res = CommunityActions.safeParse(step);\n if (res.success) {\n deps.push(...res.data);\n }\n }\n\n return deps;\n}\n\nfunction extractWithYAMLParser(\n content: string,\n packageFile: string,\n config: ExtractConfig,\n): PackageDependency[] {\n logger.trace('github-actions.extractWithYAMLParser()');\n\n const obj = withMeta({ packageFile }, () => Workflow.parse(content));\n if (!obj) {\n return [];\n }\n\n if ('runs' in obj && obj.runs.steps) {\n return extractSteps(obj.runs.steps);\n }\n\n if (!('jobs' in obj)) {\n return [];\n }\n\n const deps: PackageDependency[] = [];\n\n for (const job of Object.values(obj.jobs)) {\n if (job.container) {\n const dep = getDep(job.container, true, config.registryAliases);\n // v8 ignore else -- `getDep()` always returns a dep\n if (dep) {\n dep.depType = 'container';\n deps.push(dep);\n }\n }\n\n for (const service of job.services) {\n const dep = getDep(service, true, config.registryAliases);\n // v8 ignore else -- `getDep()` always returns a dep\n if (dep) {\n dep.depType = 'service';\n deps.push(dep);\n }\n }\n\n for (const runner of job['runs-on']) {\n const dep = extractRunner(runner);\n if (dep) {\n deps.push(dep);\n }\n }\n\n deps.push(...extractSteps(job.steps));\n }\n\n return deps;\n}\n\nasync function readLockfile(): Promise<LockfileState> {\n const content = await readLocalFile(actionsLockFile, 'utf8');\n if (!content) {\n return { type: 'missing' };\n }\n\n const parsed = ActionsLockfile.safeParse(content);\n if (!parsed.success) {\n // `updateActionsLockfile` warns about this once per branch, so stay quiet\n logger.debug(`Failed to parse ${actionsLockFile}`);\n return { type: 'unparseable' };\n }\n\n return { type: 'parsed', onboardedWorkflows: parsed.data.workflows };\n}\n\n/**\n * A repository has a single lock file, but can have any number of package files, so read and parse it only once.\n */\nfunction getLockfile(): Promise<LockfileState> {\n const cacheKey = `github-actions:${actionsLockFile}`;\n const cached = memCache.get<Promise<LockfileState> | undefined>(cacheKey);\n if (cached !== undefined) {\n return cached;\n }\n\n const result = readLockfile();\n memCache.set(cacheKey, result);\n return result;\n}\n\n/**\n * Whether `gh actions-lock` owns the digests in this file.\n *\n * It rewrites the workflows it manages back to plain refs when regenerating, so an inline digest pin would be stripped straight back out.\n */\nasync function isManagedByLockfile(packageFile: string): Promise<boolean> {\n const lockfile = await getLockfile();\n\n switch (lockfile.type) {\n case 'missing':\n return false;\n case 'unparseable':\n // The tool refuses to regenerate a lock file which it cannot parse, so treat everything as managed: pinning inline here would raise a PR which pins the digests the tool owns and leaves the lock file stale.\n return true;\n case 'parsed':\n return isLockfileManaged(packageFile, lockfile.onboardedWorkflows);\n }\n}\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n config: ExtractConfig = {}, // TODO: enforce ExtractConfig\n): Promise<PackageFileContent | null> {\n logger.trace(`github-actions.extractPackageFile(${packageFile})`);\n\n const deps = [\n ...extractWithRegex(content, config),\n ...extractWithYAMLParser(content, packageFile, config),\n ];\n\n if (!deps.length) {\n return null;\n }\n\n const res: PackageFileContent = { deps };\n\n if (await isManagedByLockfile(packageFile)) {\n // Deliberately no `lockFiles`: nothing here goes through `updateArtifacts`, and `matchFileNames` also tests `lockFiles`, so declaring it would make a negated rule such as `!.github/workflows/release.yml` match every workflow through the lock file path.\n for (const dep of deps) {\n // The lock file only records `OWNER/REPO@REF` pins, so a `docker://` image in a `uses:` is still ours to pin.\n if (dep.depType === 'action' || dep.depType === 'workflow') {\n dep.digestManagedExternally = true;\n }\n }\n }\n\n return res;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmCA,SAAS,2CAA8D;CACrE,MAAM,WAAW,aAAa,IAAI,UAAU;CAC5C,MAAM,eAAe,CAAC,oBAAoB;CAC1C,IAAI,YAAY,aAAa,IAAI,UAAU,MAAM,UAAU;EACzD,MAAM,iBAAiB,SAAS,QAAQ;EACxC,IAAI,CAAC,gBAAgB;GACnB,OAAO,KAAK,EAAE,SAAS,GAAG,8BAA8B;GACxD,OAAO,CAAC;EACV;EAEA,IACE,eAAe,SAAS,gBACxB,eAAe,SAAS,kBACxB;GACA,aAAa,QACX,GAAG,eAAe,SAAS,IAAI,eAAe,MAChD;GACA,OAAO,EAAE,aAAa;EACxB;CACF;CACA,OAAO,CAAC;AACV;AAEA,SAAS,oBACP,WACA,QACmB;CACnB,MAAM,MAAM,OAAO,UAAU,aAAa,MAAM,OAAO,eAAe;CACtE,IAAI,UAAU;CACd,IAAI,gBAAgB,UAAU;CAC9B,OAAO;AACT;AAEA,MAAM,yBAAyB,MAAM,qCAAqC;AAE1E,SAAS,wBACP,WACA,QACA,qCACmB;CACnB,MAAM,EACJ,eAAe,aACf,OACA,aACA,+BACE;CACJ,MAAM,EACJ,OACA,MACA,MAAM,SACN,KACA,UACA,uBACE;CAEJ,MAAM,cAAc,qBAAqB,WAAW,SAAS,KAAK;CAClE,MAAM,cAAc,GAAG,MAAM,GAAG;CAChC,MAAM,UAAU,GAAG,cAAc;CACjC,MAAM,aAAa,UAAU,IAAI,YAAY;CAC7C,MAAM,YAAY,8BAA8B;CAChD,MAAM,qBAAqB,CAAC,CAAC,WAAW,uBAAuB,KAAK,OAAO;CAE3E,MAAM,MAAyB;EAC7B;EACA,oBAAoB;EACpB,YAAYA;EACZ,SAAS,qBAAqB,aAAa;EAC3C,eAAe;EACf,2BAA2B,GAAG,MAAM,aAAa,WAAW,iCAAiC,MAAM,kBAA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,UAAU,MAAM;CAC7B,OAAO;AACT;;;;;;AAOA,eAAe,oBAAoB,aAAuC;CACxE,MAAM,WAAW,MAAM,YAAY;CAEnC,QAAQ,SAAS,MAAjB;EACE,KAAK,WACH,OAAO;EACT,KAAK,eAEH,OAAO;EACT,KAAK,UACH,OAAO,kBAAkB,aAAa,SAAS,kBAAkB;CACrE;AACF;AAEA,eAAsB,mBACpB,SACA,aACA,SAAwB,CAAC,GACW;CACpC,OAAO,MAAM,qCAAqC,YAAY,EAAE;CAEhE,MAAM,OAAO,CACX,GAAG,iBAAiB,SAAS,MAAM,GACnC,GAAG,sBAAsB,SAAS,aAAa,MAAM,CACvD;CAEA,IAAI,CAAC,KAAK,QACR,OAAO;CAGT,MAAM,MAA0B,EAAE,KAAK;CAEvC,IAAI,MAAM,oBAAoB,WAAW,GAElC;OAAA,MAAM,OAAO,MAEhB,IAAI,IAAI,YAAY,YAAY,IAAI,YAAY,YAC9C,IAAI,0BAA0B;CAAA;CAKpC,OAAO;AACT"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { regEx } from "../../../util/regex.js";
|
|
2
2
|
import "../../versioning/npm/index.js";
|
|
3
3
|
import { id } from "../../versioning/conda/index.js";
|
|
4
|
-
import { id as id$1 } from "../../versioning/
|
|
4
|
+
import { id as id$1 } from "../../versioning/gradle/index.js";
|
|
5
|
+
import { id as id$2 } from "../../versioning/node/index.js";
|
|
5
6
|
import { DockerDatasource } from "../../datasource/docker/index.js";
|
|
6
7
|
import { DotnetVersionDatasource } from "../../datasource/dotnet-version/index.js";
|
|
7
8
|
import { GithubReleaseAttachmentsDatasource } from "../../datasource/github-release-attachments/index.js";
|
|
8
9
|
import { GithubReleasesDatasource } from "../../datasource/github-releases/index.js";
|
|
10
|
+
import { GradleVersionDatasource } from "../../datasource/gradle-version/index.js";
|
|
9
11
|
import { JavaVersionDatasource } from "../../datasource/java-version/index.js";
|
|
10
12
|
import { NodeVersionDatasource } from "../../datasource/node-version/index.js";
|
|
11
13
|
import { NpmDatasource } from "../../datasource/npm/index.js";
|
|
@@ -138,6 +140,15 @@ const SetupJavaWith = z.object({
|
|
|
138
140
|
...parseValue(version)
|
|
139
141
|
}];
|
|
140
142
|
});
|
|
143
|
+
const TflintWith = z.object({ tflint_version: z.string().optional() }).transform(({ tflint_version: version }) => {
|
|
144
|
+
if (version === "latest") return [{
|
|
145
|
+
currentValue: version,
|
|
146
|
+
depType: "uses-with",
|
|
147
|
+
skipStage: "extract",
|
|
148
|
+
skipReason: "unsupported-version"
|
|
149
|
+
}];
|
|
150
|
+
return [parseValue(version)];
|
|
151
|
+
});
|
|
141
152
|
const renovateGithubActionDefaultImage = "ghcr.io/renovatebot/renovate";
|
|
142
153
|
const RenovateGithubActionWith = z.object({
|
|
143
154
|
"renovate-version": z.string().optional(),
|
|
@@ -177,7 +188,7 @@ const knownActions = {
|
|
|
177
188
|
datasource: GithubReleasesDatasource.id,
|
|
178
189
|
depName: "node",
|
|
179
190
|
packageName: "actions/node-versions",
|
|
180
|
-
versioning: id$
|
|
191
|
+
versioning: id$2,
|
|
181
192
|
extractVersion: actionsVersionsExtractVersion,
|
|
182
193
|
withSchema: valSchema("node-version")
|
|
183
194
|
},
|
|
@@ -242,10 +253,29 @@ const knownActions = {
|
|
|
242
253
|
packageName: "eas-cli",
|
|
243
254
|
withSchema: valSchema("eas-version")
|
|
244
255
|
},
|
|
256
|
+
"extractions/setup-just": {
|
|
257
|
+
datasource: GithubReleasesDatasource.id,
|
|
258
|
+
depName: "just",
|
|
259
|
+
packageName: "casey/just",
|
|
260
|
+
withSchema: valSchema("just-version")
|
|
261
|
+
},
|
|
245
262
|
"golangci/golangci-lint-action": {
|
|
246
263
|
datasource: GithubReleasesDatasource.id,
|
|
247
264
|
packageName: "golangci/golangci-lint"
|
|
248
265
|
},
|
|
266
|
+
"gradle/actions/setup-gradle": {
|
|
267
|
+
datasource: GradleVersionDatasource.id,
|
|
268
|
+
depName: "gradle",
|
|
269
|
+
packageName: "gradle/gradle",
|
|
270
|
+
versioning: id$1,
|
|
271
|
+
withSchema: valSchema("gradle-version")
|
|
272
|
+
},
|
|
273
|
+
"hashicorp/setup-terraform": {
|
|
274
|
+
datasource: GithubReleasesDatasource.id,
|
|
275
|
+
depName: "terraform",
|
|
276
|
+
packageName: "hashicorp/terraform",
|
|
277
|
+
withSchema: valSchema("terraform_version")
|
|
278
|
+
},
|
|
249
279
|
"helm/chart-testing-action": {
|
|
250
280
|
datasource: GithubReleasesDatasource.id,
|
|
251
281
|
depName: "chart-testing",
|
|
@@ -315,6 +345,12 @@ const knownActions = {
|
|
|
315
345
|
packageName: "sigstore/cosign",
|
|
316
346
|
withSchema: valSchema("cosign-release")
|
|
317
347
|
},
|
|
348
|
+
"terraform-linters/setup-tflint": {
|
|
349
|
+
datasource: GithubReleasesDatasource.id,
|
|
350
|
+
depName: "tflint",
|
|
351
|
+
packageName: "terraform-linters/tflint",
|
|
352
|
+
withSchema: TflintWith
|
|
353
|
+
},
|
|
318
354
|
"UpCloudLtd/upcloud-cli-action": {
|
|
319
355
|
datasource: GithubReleasesDatasource.id,
|
|
320
356
|
packageName: "UpCloudLtd/upcloud-cli"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"known-actions.js","names":["nodeVersioning.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 { 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 { 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 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// 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\nconst InstallBinaryWith: ActionSchema = z\n .object({ repo: z.string(), tag: z.string() })\n .transform(({ repo, tag }) => [{ packageName: repo, ...parseValue(tag) }]);\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\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/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/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/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-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/expo/expo-github-action\n 'expo/expo-github-action': {\n datasource: NpmDatasource.id,\n packageName: 'eas-cli',\n withSchema: valSchema('eas-version'),\n },\n 'golangci/golangci-lint-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'golangci/golangci-lint',\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 '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 '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 '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/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/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 '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 'UpCloudLtd/upcloud-cli-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'UpCloudLtd/upcloud-cli',\n },\n 'zizmorcore/zizmor-action': {\n datasource: DockerDatasource.id,\n packageName: 'ghcr.io/zizmorcore/zizmor',\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,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;GAAK,GAAG;EAAI;EAChC,OAAO,YAAY,OAAO;EAC1B,OAAO;CACT,CAAC,CACH;AACJ;AAEA,SAAS,YAAY,QAA6B;CAChD,OAAO,EACJ,OAAO,CAAC,CACR,MAAM,MAAM,uBAAuB,OAAO,OAAO,MAAM,EAAE,UAAU,CAAC;AACzE;AAEA,SAAS,WACP,cACA,WACmB;CACnB,IAAI,CAAC,cACH,OAAO;EACL,WAAW;EACX,YAAY;EACZ,SAAS;CACX;CAEF,IAAI,YAAY,YAAY,MAAM,MAChC,OAAO;EACL,WAAW;EACX,YAAY;EACZ,SAAS;EACT;CACF;CAEF,OAAO;EAAE;EAAc,SAAS;CAAY;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C3B,YAAY,yBAAyB;EACrC,aAAa;EACb,YAAY,UAAU,gBAAgB;CACxC;CACA,iCAAiC;EAC/B,YAAY,yBAAyB;EACrC,aAAa;CACf;CACA,4BAA4B;EAC1B,YAAY,iBAAiB;EAC7B,aAAa;CACf;AACF"}
|
|
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 { 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// 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\nconst InstallBinaryWith: ActionSchema = z\n .object({ repo: z.string(), tag: z.string() })\n .transform(({ repo, tag }) => [{ packageName: repo, ...parseValue(tag) }]);\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\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/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/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/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-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/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 'golangci/golangci-lint-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'golangci/golangci-lint',\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'),\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-testing-action\n 'helm/chart-testing-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'chart-testing',\n packageName: 'helm/chart-testing',\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 '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 '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/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/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 '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/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 'zizmorcore/zizmor-action': {\n datasource: DockerDatasource.id,\n packageName: 'ghcr.io/zizmorcore/zizmor',\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,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;GAAK,GAAG;EAAI;EAChC,OAAO,YAAY,OAAO;EAC1B,OAAO;CACT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AAU,mBAAmB;CAC3C;CAEA,6BAA6B;EAC3B,YAAY,yBAAyB;EACrC,SAAS;EACT,aAAa;CACf;CACA,6BAA6B;EAC3B,YAAY,cAAc;EAC1B,aAAa;EACb,YAAY,UAAU,YAAY,QAAQ,QAAQ,MAAM;CAC1D;CACA,uCAAuC;EACrC,YAAY,yBAAyB;EACrC,aAAa;EACb,YAAY;CACd;CACA,mBAAmB;EACjB,YAAY,mCAAmC;EAC/C,aAAa;EACb,YAAY;CACd;CACA,qBAAqB;EACnB,YAAY,cAAc;EAC1B,aAAa;EACb,YAAY,UAAU,aAAa;CACrC;CACA,yBAAyB;EACvB,YAAY,eAAe;EAC3B,aAAa;CACf;CACA,qBAAqB;EACnB,YAAY,cAAc;EAC1B,aAAa;CACf;CACA,cAAc;EACZ,YAAY,cAAc;EAC1B,aAAa;EACb,YAAY;CACd;CACA,yBAAyB;EACvB,YAAY,yBAAyB;EACrC,YAAYC;EACZ,aAAa;EACb,YAAY,UAAU,cAAc;CACtC;CAEA,cAAc;EACZ,YAAY,yBAAyB;EACrC,aAAa;EAEb,gBAAgB;CAClB;CAEA,6BAA6B;EAC3B,YAAY,iBAAiB;EAC7B,aAAa;EACb,YAAY;CACd;CACA,mBAAmB;EACjB,YAAY,sBAAsB;EAClC,aAAa;EACb,YAAY,UAAU,cAAc;CACtC;CACA,0BAA0B;EACxB,YAAY,yBAAyB;EACrC,aAAa;EACb,YAAY;CACd;CACA,6BAA6B;EAC3B,YAAY,yBAAyB;EACrC,aAAa;EACb,YAAY,UAAU,gBAAgB;CACxC;CAEA,kCAAkC;EAChC,YAAY,yBAAyB;EACrC,SAAS;EACT,aAAa;EACb,YAAY;CACd;CACA,iCAAiC;EAC/B,YAAY,yBAAyB;EACrC,aAAa;CACf;CACA,4BAA4B;EAC1B,YAAY,iBAAiB;EAC7B,aAAa;CACf;AACF"}
|
|
@@ -93,6 +93,7 @@ async function extractAllPackageFiles(config, packageFiles) {
|
|
|
93
93
|
filesToExamine.push(file);
|
|
94
94
|
}
|
|
95
95
|
const result = extractPackageFile(content, file, config);
|
|
96
|
+
// v8 ignore else -- needs a listed file that yields no deps
|
|
96
97
|
if (result !== null) results.push({
|
|
97
98
|
packageFile: file,
|
|
98
99
|
deps: result.deps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","names":["semverPartialId"],"sources":["../../../../lib/modules/manager/gitlabci/extract.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { Result } from '../../../util/result.ts';\nimport { parseYaml } from '../../../util/yaml.ts';\nimport { GitlabTagsDatasource } from '../../datasource/gitlab-tags/index.ts';\nimport { id as semverPartialId } from '../../versioning/semver-partial/index.ts';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFile,\n PackageFileContent,\n} from '../types.ts';\nimport {\n GitlabDocument,\n Job,\n Jobs,\n MultiDocumentLocalIncludes,\n} from './schema.ts';\nimport { getGitlabDep } from './utils.ts';\n\n// See https://docs.gitlab.com/ee/ci/components/index.html#use-a-component\nconst componentReferenceRegex = regEx(\n /(?<fqdn>[^/]+)\\/(?<projectPath>.+)\\/(?:.+)@(?<specificVersion>.+)/,\n);\n\nfunction extractDepFromIncludeComponent(\n component: string,\n registryAliases?: Record<string, string>,\n): PackageDependency | null {\n let componentUrl = component;\n if (registryAliases) {\n for (const key in registryAliases) {\n componentUrl = componentUrl.replace(key, registryAliases[key]);\n }\n }\n const componentReference = componentReferenceRegex.exec(componentUrl)?.groups;\n if (!componentReference) {\n logger.debug(\n { componentReference: componentUrl },\n 'Ignoring malformed component reference',\n );\n return null;\n }\n const projectPathParts = componentReference.projectPath.split('/');\n if (projectPathParts.length < 2) {\n logger.debug(\n { componentReference: componentUrl },\n 'Ignoring component reference with incomplete project path',\n );\n return null;\n }\n\n const dep: PackageDependency = {\n datasource: GitlabTagsDatasource.id,\n depName: componentReference.projectPath,\n depType: 'repository',\n currentValue: componentReference.specificVersion,\n registryUrls: [`https://${componentReference.fqdn}`],\n versioning: semverPartialId,\n };\n return dep;\n}\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n config: ExtractConfig,\n): PackageFileContent | null {\n const deps: PackageDependency[] = [];\n try {\n const docs = parseYaml(content, { uniqueKeys: false });\n\n for (const doc of docs) {\n const topLevel = Job.parse(doc);\n const jobs = Jobs.parse(doc);\n\n for (const job of [topLevel, ...jobs]) {\n const { image, services } = job;\n\n if (image) {\n const dep = getGitlabDep(image.value, config.registryAliases);\n dep.depType = image.type;\n deps.push(dep);\n }\n\n for (const service of services) {\n const dep = getGitlabDep(service, config.registryAliases);\n dep.depType = 'service-image';\n deps.push(dep);\n }\n }\n\n const includedComponents = GitlabDocument.parse(doc);\n for (const includedComponent of includedComponents) {\n const dep = extractDepFromIncludeComponent(\n includedComponent,\n config.registryAliases,\n );\n if (dep) {\n deps.push(dep);\n }\n }\n }\n } catch (err) /* istanbul ignore next */ {\n if (err.stack?.startsWith('YAMLException:')) {\n logger.debug(\n { err, packageFile },\n 'YAML exception extracting GitLab CI includes',\n );\n } else {\n logger.debug(\n { err, packageFile },\n 'Error extracting GitLab CI dependencies',\n );\n }\n }\n\n return deps.length ? { deps } : null;\n}\n\nexport async function extractAllPackageFiles(\n config: ExtractConfig,\n packageFiles: string[],\n): Promise<PackageFile[] | null> {\n const filesToExamine = [...packageFiles];\n const seen = new Set<string>(packageFiles);\n const results: PackageFile[] = [];\n\n // extract all includes from the files\n while (filesToExamine.length > 0) {\n const file = filesToExamine.pop()!;\n\n const content = await readLocalFile(file, 'utf8');\n if (!content) {\n logger.debug(\n { packageFile: file },\n `Empty or non existent gitlabci file`,\n );\n continue;\n }\n\n const { val: docs, err } = Result.wrap(() =>\n parseYaml(content, { uniqueKeys: false }),\n ).unwrap();\n\n if (err) {\n logger.debug(\n { err, packageFile: file },\n 'Error extracting GitLab CI dependencies',\n );\n continue;\n }\n\n const localIncludes = MultiDocumentLocalIncludes.parse(docs);\n for (const file of localIncludes) {\n if (!seen.has(file)) {\n seen.add(file);\n filesToExamine.push(file);\n }\n }\n\n const result = extractPackageFile(content, file, config);\n if (result !== null) {\n results.push({\n packageFile: file,\n deps: result.deps,\n });\n }\n }\n\n logger.trace(\n { packageFiles, files: filesToExamine.entries() },\n 'extracted all GitLab CI files',\n );\n\n if (!results.length) {\n return null;\n }\n\n return results;\n}\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,0BAA0B,MAC9B,mEACF;AAEA,SAAS,+BACP,WACA,iBAC0B;CAC1B,IAAI,eAAe;CACnB,IAAI,iBACF,KAAK,MAAM,OAAO,iBAChB,eAAe,aAAa,QAAQ,KAAK,gBAAgB,IAAI;CAGjE,MAAM,qBAAqB,wBAAwB,KAAK,YAAY,CAAC,EAAE;CACvE,IAAI,CAAC,oBAAoB;EACvB,OAAO,MACL,EAAE,oBAAoB,aAAa,GACnC,wCACF;EACA,OAAO;CACT;CAEA,IADyB,mBAAmB,YAAY,MAAM,GAC3C,CAAC,CAAC,SAAS,GAAG;EAC/B,OAAO,MACL,EAAE,oBAAoB,aAAa,GACnC,2DACF;EACA,OAAO;CACT;CAUA,OAAO;EAPL,YAAY,qBAAqB;EACjC,SAAS,mBAAmB;EAC5B,SAAS;EACT,cAAc,mBAAmB;EACjC,cAAc,CAAC,WAAW,mBAAmB,MAAM;EACnD,YAAYA;CAEL;AACX;AAEA,SAAgB,mBACd,SACA,aACA,QAC2B;CAC3B,MAAM,OAA4B,CAAC;CACnC,IAAI;EACF,MAAM,OAAO,UAAU,SAAS,EAAE,YAAY,MAAM,CAAC;EAErD,KAAK,MAAM,OAAO,MAAM;GACtB,MAAM,WAAW,IAAI,MAAM,GAAG;GAC9B,MAAM,OAAO,KAAK,MAAM,GAAG;GAE3B,KAAK,MAAM,OAAO,CAAC,UAAU,GAAG,IAAI,GAAG;IACrC,MAAM,EAAE,OAAO,aAAa;IAE5B,IAAI,OAAO;KACT,MAAM,MAAM,aAAa,MAAM,O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;EAGF,MAAM,SAAS,mBAAmB,SAAS,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"extract.js","names":["semverPartialId"],"sources":["../../../../lib/modules/manager/gitlabci/extract.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { Result } from '../../../util/result.ts';\nimport { parseYaml } from '../../../util/yaml.ts';\nimport { GitlabTagsDatasource } from '../../datasource/gitlab-tags/index.ts';\nimport { id as semverPartialId } from '../../versioning/semver-partial/index.ts';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFile,\n PackageFileContent,\n} from '../types.ts';\nimport {\n GitlabDocument,\n Job,\n Jobs,\n MultiDocumentLocalIncludes,\n} from './schema.ts';\nimport { getGitlabDep } from './utils.ts';\n\n// See https://docs.gitlab.com/ee/ci/components/index.html#use-a-component\nconst componentReferenceRegex = regEx(\n /(?<fqdn>[^/]+)\\/(?<projectPath>.+)\\/(?:.+)@(?<specificVersion>.+)/,\n);\n\nfunction extractDepFromIncludeComponent(\n component: string,\n registryAliases?: Record<string, string>,\n): PackageDependency | null {\n let componentUrl = component;\n if (registryAliases) {\n for (const key in registryAliases) {\n componentUrl = componentUrl.replace(key, registryAliases[key]);\n }\n }\n const componentReference = componentReferenceRegex.exec(componentUrl)?.groups;\n if (!componentReference) {\n logger.debug(\n { componentReference: componentUrl },\n 'Ignoring malformed component reference',\n );\n return null;\n }\n const projectPathParts = componentReference.projectPath.split('/');\n if (projectPathParts.length < 2) {\n logger.debug(\n { componentReference: componentUrl },\n 'Ignoring component reference with incomplete project path',\n );\n return null;\n }\n\n const dep: PackageDependency = {\n datasource: GitlabTagsDatasource.id,\n depName: componentReference.projectPath,\n depType: 'repository',\n currentValue: componentReference.specificVersion,\n registryUrls: [`https://${componentReference.fqdn}`],\n versioning: semverPartialId,\n };\n return dep;\n}\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n config: ExtractConfig,\n): PackageFileContent | null {\n const deps: PackageDependency[] = [];\n try {\n const docs = parseYaml(content, { uniqueKeys: false });\n\n for (const doc of docs) {\n const topLevel = Job.parse(doc);\n const jobs = Jobs.parse(doc);\n\n for (const job of [topLevel, ...jobs]) {\n const { image, services } = job;\n\n if (image) {\n const dep = getGitlabDep(image.value, config.registryAliases);\n dep.depType = image.type;\n deps.push(dep);\n }\n\n for (const service of services) {\n const dep = getGitlabDep(service, config.registryAliases);\n dep.depType = 'service-image';\n deps.push(dep);\n }\n }\n\n const includedComponents = GitlabDocument.parse(doc);\n for (const includedComponent of includedComponents) {\n const dep = extractDepFromIncludeComponent(\n includedComponent,\n config.registryAliases,\n );\n if (dep) {\n deps.push(dep);\n }\n }\n }\n } catch (err) /* istanbul ignore next */ {\n if (err.stack?.startsWith('YAMLException:')) {\n logger.debug(\n { err, packageFile },\n 'YAML exception extracting GitLab CI includes',\n );\n } else {\n logger.debug(\n { err, packageFile },\n 'Error extracting GitLab CI dependencies',\n );\n }\n }\n\n return deps.length ? { deps } : null;\n}\n\nexport async function extractAllPackageFiles(\n config: ExtractConfig,\n packageFiles: string[],\n): Promise<PackageFile[] | null> {\n const filesToExamine = [...packageFiles];\n const seen = new Set<string>(packageFiles);\n const results: PackageFile[] = [];\n\n // extract all includes from the files\n while (filesToExamine.length > 0) {\n const file = filesToExamine.pop()!;\n\n const content = await readLocalFile(file, 'utf8');\n if (!content) {\n logger.debug(\n { packageFile: file },\n `Empty or non existent gitlabci file`,\n );\n continue;\n }\n\n const { val: docs, err } = Result.wrap(() =>\n parseYaml(content, { uniqueKeys: false }),\n ).unwrap();\n\n if (err) {\n logger.debug(\n { err, packageFile: file },\n 'Error extracting GitLab CI dependencies',\n );\n continue;\n }\n\n const localIncludes = MultiDocumentLocalIncludes.parse(docs);\n for (const file of localIncludes) {\n if (!seen.has(file)) {\n seen.add(file);\n filesToExamine.push(file);\n }\n }\n\n const result = extractPackageFile(content, file, config);\n // v8 ignore else -- needs a listed file that yields no deps\n if (result !== null) {\n results.push({\n packageFile: file,\n deps: result.deps,\n });\n }\n }\n\n logger.trace(\n { packageFiles, files: filesToExamine.entries() },\n 'extracted all GitLab CI files',\n );\n\n if (!results.length) {\n return null;\n }\n\n return results;\n}\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,0BAA0B,MAC9B,mEACF;AAEA,SAAS,+BACP,WACA,iBAC0B;CAC1B,IAAI,eAAe;CACnB,IAAI,iBACF,KAAK,MAAM,OAAO,iBAChB,eAAe,aAAa,QAAQ,KAAK,gBAAgB,IAAI;CAGjE,MAAM,qBAAqB,wBAAwB,KAAK,YAAY,CAAC,EAAE;CACvE,IAAI,CAAC,oBAAoB;EACvB,OAAO,MACL,EAAE,oBAAoB,aAAa,GACnC,wCACF;EACA,OAAO;CACT;CAEA,IADyB,mBAAmB,YAAY,MAAM,GAC3C,CAAC,CAAC,SAAS,GAAG;EAC/B,OAAO,MACL,EAAE,oBAAoB,aAAa,GACnC,2DACF;EACA,OAAO;CACT;CAUA,OAAO;EAPL,YAAY,qBAAqB;EACjC,SAAS,mBAAmB;EAC5B,SAAS;EACT,cAAc,mBAAmB;EACjC,cAAc,CAAC,WAAW,mBAAmB,MAAM;EACnD,YAAYA;CAEL;AACX;AAEA,SAAgB,mBACd,SACA,aACA,QAC2B;CAC3B,MAAM,OAA4B,CAAC;CACnC,IAAI;EACF,MAAM,OAAO,UAAU,SAAS,EAAE,YAAY,MAAM,CAAC;EAErD,KAAK,MAAM,OAAO,MAAM;GACtB,MAAM,WAAW,IAAI,MAAM,GAAG;GAC9B,MAAM,OAAO,KAAK,MAAM,GAAG;GAE3B,KAAK,MAAM,OAAO,CAAC,UAAU,GAAG,IAAI,GAAG;IACrC,MAAM,EAAE,OAAO,aAAa;IAE5B,IAAI,OAAO;KACT,MAAM,MAAM,aAAa,MAAM,OAAO,OAAO,eAAe;KAC5D,IAAI,UAAU,MAAM;KACpB,KAAK,KAAK,GAAG;IACf;IAEA,KAAK,MAAM,WAAW,UAAU;KAC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,OAAO;EACf,CAAC;CAEL;CAEA,OAAO,MACL;EAAE;EAAc,OAAO,eAAe,QAAQ;CAAE,GAChD,+BACF;CAEA,IAAI,CAAC,QAAQ,QACX,OAAO;CAGT,OAAO;AACT"}
|
|
@@ -37,6 +37,7 @@ function resolvePackageDependencies(packages, repositories) {
|
|
|
37
37
|
function findRepository(name, repositories) {
|
|
38
38
|
for (const repository of repositories) {
|
|
39
39
|
if (name === repository.metadata.name) return repository;
|
|
40
|
+
// v8 ignore else -- needs a manifest whose repositories match no name
|
|
40
41
|
if (isFalsy(name) && isDefaultRepository(repository)) return repository;
|
|
41
42
|
}
|
|
42
43
|
return null;
|
|
@@ -53,6 +54,7 @@ async function extractAllPackageFiles(_config, packageFiles) {
|
|
|
53
54
|
const glasskubeResourceFiles = [];
|
|
54
55
|
for (const packageFile of packageFiles) {
|
|
55
56
|
const content = await readLocalFile(packageFile, "utf8");
|
|
57
|
+
// v8 ignore else -- needs a listed package file that cannot be read
|
|
56
58
|
if (content !== null) {
|
|
57
59
|
const resources = parseResources(content, packageFile);
|
|
58
60
|
allRepositories.push(...resources.repositories);
|