diff --git a/dist/index.js b/dist/index.js index 3b20468..cd7e515 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1065,7 +1065,7 @@ function run() { }); } if (git_gpgsign) { - core.info(`🔨 Configuring git committer to be ${git_committer_name} <${git_committer_email}>`); + core.info(`🔨 Configuring Git committer (${git_committer_name} <${git_committer_email}>)`); if (git_committer_email != privateKey.email) { core.setFailed('Committer email does not match GPG key user address'); return; @@ -1073,8 +1073,8 @@ function run() { yield git.setConfig('user.name', git_committer_name); yield git.setConfig('user.email', git_committer_email); core.info('💎 Enable signing for this Git repository'); - yield git.enableCommitGpgsign(); - yield git.setUserSigningkey(privateKey.keyID); + yield git.setConfig('commit.gpgsign', 'true'); + yield git.setConfig('user.signingkey', privateKey.keyID); } } catch (error) { @@ -1420,18 +1420,6 @@ const git = (args = []) => __awaiter(void 0, void 0, void 0, function* () { return res.stdout.trim(); }); }); -function enableCommitGpgsign() { - return __awaiter(this, void 0, void 0, function* () { - yield git(['config', 'commit.gpgsign', 'true']); - }); -} -exports.enableCommitGpgsign = enableCommitGpgsign; -function setUserSigningkey(keyid) { - return __awaiter(this, void 0, void 0, function* () { - yield git(['config', 'user.signingkey', keyid]); - }); -} -exports.setUserSigningkey = setUserSigningkey; function getConfig(key) { return __awaiter(this, void 0, void 0, function* () { return yield git(['config', key]); diff --git a/src/git.ts b/src/git.ts index 5fd97b9..16930c7 100644 --- a/src/git.ts +++ b/src/git.ts @@ -9,14 +9,6 @@ const git = async (args: string[] = []): Promise => { }); }; -export async function enableCommitGpgsign(): Promise { - await git(['config', 'commit.gpgsign', 'true']); -} - -export async function setUserSigningkey(keyid: string): Promise { - await git(['config', 'user.signingkey', keyid]); -} - export async function getConfig(key: string): Promise { return await git(['config', key]); } diff --git a/src/main.ts b/src/main.ts index 25aaf00..41039f6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -60,18 +60,17 @@ async function run(): Promise { } if (git_gpgsign) { - core.info(`🔨 Configuring git committer to be ${git_committer_name} <${git_committer_email}>`); + core.info(`🔨 Configuring Git committer (${git_committer_name} <${git_committer_email}>)`); if (git_committer_email != privateKey.email) { core.setFailed('Committer email does not match GPG key user address'); return; } - await git.setConfig('user.name', git_committer_name); await git.setConfig('user.email', git_committer_email); core.info('💎 Enable signing for this Git repository'); - await git.enableCommitGpgsign(); - await git.setUserSigningkey(privateKey.keyID); + await git.setConfig('commit.gpgsign', 'true'); + await git.setConfig('user.signingkey', privateKey.keyID); } } catch (error) { core.setFailed(error.message);