@@ -131,6 +131,7 @@ export default class ReleasePromotion extends Session {
131
131
throw new Error ( 'Aborted' ) ;
132
132
}
133
133
await this . secureTagRelease ( ) ;
134
+ await this . verifyTagSignature ( ) ;
134
135
135
136
// Set up for next release.
136
137
cli . startSpinner ( 'Setting up for next release' ) ;
@@ -223,6 +224,28 @@ export default class ReleasePromotion extends Session {
223
224
this . isLTS ? '=false' : '' } --title=${ JSON . stringify ( this . releaseTitle ) } --notes-file -`) ;
224
225
}
225
226
227
+ async verifyTagSignature ( ) {
228
+ const { cli, version } = this ;
229
+ const [ needle , haystack ] = await Promise . all ( [ forceRunAsync (
230
+ 'git' , [ '--no-pager' ,
231
+ 'log' , '-1' ,
232
+ `refs/tags/v${ version } ` ,
233
+ '--format=* **%an** <<%ae>>\n `%GF`'
234
+ ] , { captureStdout : true } ) , fs . readFile ( 'README.md' ) ] ) ;
235
+ if ( haystack . includes ( needle ) ) {
236
+ return ;
237
+ }
238
+ cli . warn ( 'Tag was signed with an undocumented identity/key pair!' ) ;
239
+ cli . info ( 'Expected to find the following entry in the README:' ) ;
240
+ cli . info ( needle ) ;
241
+ cli . info ( 'If you are using a subkey, it might be OK.' ) ;
242
+ cli . info ( `Otherwise consider removing the tag (git tag -d v${ version
243
+ } ), check your local config, and start the process over.`) ;
244
+ if ( ! await cli . prompt ( 'Do you want to proceed anyway?' , { defaultAnswer : false } ) ) {
245
+ throw new Error ( 'Aborted' ) ;
246
+ }
247
+ }
248
+
226
249
async verifyPRAttributes ( ) {
227
250
const { cli, prid, owner, repo, req } = this ;
228
251
0 commit comments