Skip to content

Commit

Permalink
fix: update azure to use runExternalProgram
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu-codecov committed Jan 10, 2024
1 parent 4ee9ee5 commit eec8d25
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ci_providers/provider_azurepipelines.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import childProcess from 'child_process'
import { parseSlugFromRemoteAddr } from '../helpers/git'
import { info } from '../helpers/logger'
import { runExternalProgram } from "../helpers/util"
import { IServiceParams, UploaderEnvs, UploaderInputs } from '../types'

export function detect(envs: UploaderEnvs): boolean {
Expand Down Expand Up @@ -59,10 +59,7 @@ function _getSHA(inputs: UploaderInputs): string {

if (_getPR(inputs)) {
const mergeCommitRegex = /^[a-z0-9]{40} [a-z0-9]{40}$/
const mergeCommitMessage = childProcess
.execFileSync('git', ['show', '--no-patch', '--format=%P'])
.toString()
.trimRight()
const mergeCommitMessage = runExternalProgram('git', ['show', '--no-patch', '--format=%P'])
if (mergeCommitRegex.exec(mergeCommitMessage)) {
const mergeCommit = mergeCommitMessage.split(' ')[1]
info(` Fixing merge commit SHA ${commit} -> ${mergeCommit}`)
Expand Down

0 comments on commit eec8d25

Please sign in to comment.