diff --git a/lib/modules/manager/github-actions/community.ts b/lib/modules/manager/github-actions/community.ts index 49cbca090a..a2487daf41 100644 --- a/lib/modules/manager/github-actions/community.ts +++ b/lib/modules/manager/github-actions/community.ts @@ -6,6 +6,7 @@ import { GithubReleasesDatasource } from '../../datasource/github-releases/index import { NpmDatasource } from '../../datasource/npm/index.ts'; import { PypiDatasource } from '../../datasource/pypi/index.ts'; import { RubyVersionDatasource } from '../../datasource/ruby-version/index.ts'; +import { RustVersionDatasource } from '../../datasource/rust-version/index.ts'; import * as condaVersioning from '../../versioning/conda/index.ts'; import * as npmVersioning from '../../versioning/npm/index.ts'; import type { PackageDependency } from '../types.ts'; @@ -140,6 +141,12 @@ export const communityActions: Record = { packageName: 'moby/moby', extractVersion: '^docker-(?.+)$', }, + // https://github.com/dtolnay/rust-toolchain + 'dtolnay/rust-toolchain': { + datasource: RustVersionDatasource.id, + packageName: 'rust', + withSchema: valSchema('toolchain'), + }, 'golangci/golangci-lint-action': { datasource: GithubReleasesDatasource.id, packageName: 'golangci/golangci-lint', diff --git a/lib/modules/manager/github-actions/extract.spec.ts b/lib/modules/manager/github-actions/extract.spec.ts index 470fb9db41..9315c0d9a5 100644 --- a/lib/modules/manager/github-actions/extract.spec.ts +++ b/lib/modules/manager/github-actions/extract.spec.ts @@ -1685,6 +1685,67 @@ describe('modules/manager/github-actions/extract', () => { }, ], }, + { + step: { + uses: 'dtolnay/rust-toolchain@master', + with: { toolchain: '1.89.0' }, + }, + expected: [ + { + currentValue: '1.89.0', + datasource: 'rust-version', + depName: 'rust', + depType: 'uses-with', + packageName: 'rust', + }, + ], + }, + { + step: { + uses: 'dtolnay/rust-toolchain@master', + with: { toolchain: 'nightly-2025-01-01' }, + }, + expected: [ + { + currentValue: 'nightly-2025-01-01', + datasource: 'rust-version', + depName: 'rust', + depType: 'uses-with', + packageName: 'rust', + }, + ], + }, + { + step: { + uses: 'dtolnay/rust-toolchain@stable', + with: { toolchain: 'stable' }, + }, + expected: [ + { + currentValue: 'stable', + datasource: 'rust-version', + depName: 'rust', + depType: 'uses-with', + packageName: 'rust', + }, + ], + }, + { + step: { + uses: 'dtolnay/rust-toolchain@master', + with: {}, + }, + expected: [ + { + datasource: 'rust-version', + depName: 'rust', + depType: 'uses-with', + packageName: 'rust', + skipStage: 'extract', + skipReason: 'unspecified-version', + }, + ], + }, ])('extract from $step.uses', ({ step, expected }) => { const yamlContent = yaml.dump({ jobs: { build: { steps: [step] } } }); diff --git a/lib/modules/manager/github-actions/index.ts b/lib/modules/manager/github-actions/index.ts index 39b57f1af7..1313adc951 100644 --- a/lib/modules/manager/github-actions/index.ts +++ b/lib/modules/manager/github-actions/index.ts @@ -3,6 +3,7 @@ import { GiteaTagsDatasource } from '../../datasource/gitea-tags/index.ts'; import { GithubDigestDatasource } from '../../datasource/github-digest/index.ts'; import { GithubRunnersDatasource } from '../../datasource/github-runners/index.ts'; import { GithubTagsDatasource } from '../../datasource/github-tags/index.ts'; +import { RustVersionDatasource } from '../../datasource/rust-version/index.ts'; export { knownDepTypes } from './dep-types.ts'; export { extractPackageFile } from './extract.ts'; @@ -23,4 +24,5 @@ export const supportedDatasources = [ GithubDigestDatasource.id, GithubRunnersDatasource.id, GithubTagsDatasource.id, + RustVersionDatasource.id, ];