| 183 | } |
| 184 | |
| 185 | export async function getCommitMessage(hash: string): Promise<string | null> { |
| 186 | try { |
| 187 | // returns an list of commit hashes |
| 188 | const { stdout, stderr } = await exec({ command: `git log -n 1 --pretty=format:%s ${hash}` }) |
| 189 | if (stderr) { |
| 190 | return null |
| 191 | } |
| 192 | // string match on remote output |
| 193 | return stdout |
| 194 | } catch (error: any) { |
| 195 | logger(`Error: ${error.message}`) |
| 196 | // likely no git commit message found |
| 197 | return null |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | export async function commitsExistsByMessage(message: string): Promise<boolean> { |
| 202 | try { |