diff --git a/lib/workers/pr/body/updates-table.ts b/lib/workers/pr/body/updates-table.ts index 5e368b88238877899e37544dcbf869de1be8b7f0..ea41b9ee67f09a251ffbfac50b68f856b585e3d8 100644 --- a/lib/workers/pr/body/updates-table.ts +++ b/lib/workers/pr/body/updates-table.ts @@ -59,7 +59,7 @@ export function getPrUpdatesTable(config: BranchConfig): string { if (value) { res[header] = template .compile(value, upgrade) - .replace(regEx(/^``$/), ''); + .replace(regEx(/``/g), ''); } else { res[header] = ''; } diff --git a/lib/workers/repository/updates/generate.spec.ts b/lib/workers/repository/updates/generate.spec.ts index e0bed221d578642867132bdeae1990179b69ea60..779ce363cd69a8b49d43b67031e2257dea8ffc92 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -1,6 +1,7 @@ import { defaultConfig, partial } from '../../../../test/util'; import type { UpdateType } from '../../../config/types'; import { NpmDatasource } from '../../../datasource/npm'; +import type { LookupUpdate } from '../../../manager/types'; import type { BranchUpgradeConfig } from '../../types'; import { generateBranchConfig } from './generate'; @@ -341,6 +342,20 @@ describe('workers/repository/updates/generate', () => { expect(res.recreateClosed).toBeTrue(); expect(res.groupName).toBeDefined(); }); + it('pins digest to table', () => { + const branch = [ + partial<LookupUpdate & BranchUpgradeConfig>({ + ...defaultConfig, + depName: 'foo-image', + newDigest: 'abcdefg987612345', + currentDigest: '', + updateType: 'pin', + }), + ]; + const res = generateBranchConfig(branch); + expect(res.upgrades[0].displayFrom).toBe(''); + expect(res.upgrades[0].displayTo).toBe('abcdefg'); + }); it('fixes different messages', () => { const branch = [ { diff --git a/lib/workers/repository/updates/generate.ts b/lib/workers/repository/updates/generate.ts index d9cae64c970efdf2a895cc689ec68346a90d9b86..dd24c2c1d57240d18edfbe8e86b6801486433bd5 100644 --- a/lib/workers/repository/updates/generate.ts +++ b/lib/workers/repository/updates/generate.ts @@ -115,7 +115,7 @@ export function generateBranchConfig( upgrade.newDigestShort || upgrade.newDigest.replace('sha256:', '').substring(0, 7); } - if (upgrade.isDigest) { + if (upgrade.isDigest || upgrade.updateType === 'pin') { upgrade.displayFrom = upgrade.currentDigestShort; upgrade.displayTo = upgrade.newDigestShort; } else if (upgrade.isLockfileUpdate) {