@@ -52,7 +52,7 @@ async function configureAuthentication() {
5252 const gpgHome = await _gpg_js__WEBPACK_IMPORTED_MODULE_5__ /* .importKey */ . Fh ( gpgPrivateKey ) ;
5353 try {
5454 _actions_core__WEBPACK_IMPORTED_MODULE_1__ /* .saveState */ . LZ ( _constants_js__WEBPACK_IMPORTED_MODULE_7__ /* .STATE_GPG_HOME */ . Fi , gpgHome ) ;
55- _actions_core__WEBPACK_IMPORTED_MODULE_1__ /* .exportVariable */ . dN ( 'GNUPGHOME' , gpgHome ) ;
55+ _actions_core__WEBPACK_IMPORTED_MODULE_1__ /* .exportVariable */ . dN ( 'GNUPGHOME' , _gpg_js__WEBPACK_IMPORTED_MODULE_5__ /* .toGpgPath */ . nY ( gpgHome ) ) ;
5656 }
5757 catch ( error ) {
5858 await _gpg_js__WEBPACK_IMPORTED_MODULE_5__ /* .removeGpgHome */ . mS ( gpgHome ) ;
@@ -132,9 +132,10 @@ async function write(directory, settings, overwriteSettings) {
132132/* harmony export */ __webpack_require__ . d ( __webpack_exports__ , {
133133/* harmony export */ Fh : ( ) => ( /* binding */ importKey ) ,
134134/* harmony export */ Yi : ( ) => ( /* binding */ verifyPackageSignature ) ,
135- /* harmony export */ mS : ( ) => ( /* binding */ removeGpgHome )
135+ /* harmony export */ mS : ( ) => ( /* binding */ removeGpgHome ) ,
136+ /* harmony export */ nY : ( ) => ( /* binding */ toGpgPath )
136137/* harmony export */ } ) ;
137- /* unused harmony exports GPG_HOME_PREFIX, toGpgPath */
138+ /* unused harmony export GPG_HOME_PREFIX */
138139/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__ ( 9896 ) ;
139140/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__ . n ( fs__WEBPACK_IMPORTED_MODULE_0__ ) ;
140141/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__ ( 6928 ) ;
@@ -196,7 +197,7 @@ async function importKey(privateKey) {
196197 return gpgHome ;
197198 }
198199 catch ( error ) {
199- await _actions_io__WEBPACK_IMPORTED_MODULE_3__ /* .rmRF */ . Yz ( gpgHome ) ;
200+ await removeGpgHome ( gpgHome ) ;
200201 throw error ;
201202 }
202203}
@@ -210,6 +211,15 @@ async function removeGpgHome(gpgHome) {
210211 ! path__WEBPACK_IMPORTED_MODULE_1__ . basename ( resolvedGpgHome ) . startsWith ( GPG_HOME_PREFIX ) ) {
211212 throw new Error ( `Refusing to remove unexpected GPG home: ${ gpgHome } ` ) ;
212213 }
214+ if ( ! fs__WEBPACK_IMPORTED_MODULE_0__ . existsSync ( resolvedGpgHome ) ) {
215+ return ;
216+ }
217+ try {
218+ await _actions_exec__WEBPACK_IMPORTED_MODULE_4__ /* .exec */ . m ( 'gpgconf' , [ '--homedir' , toGpgPath ( resolvedGpgHome ) , '--kill' , 'gpg-agent' ] , { silent : true , ignoreReturnCode : true } ) ;
219+ }
220+ catch {
221+ // gpgconf may be unavailable, but directory removal must still be attempted.
222+ }
213223 await _actions_io__WEBPACK_IMPORTED_MODULE_3__ /* .rmRF */ . Yz ( resolvedGpgHome ) ;
214224}
215225async function verifyPackageSignature ( archivePath , signatureUrl , publicKeyContent ) {
0 commit comments