[ci-metrics] Use git rev-parse for branch (#114736)

--show-current was added in 2.22, which is still relatively new.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
Tyler Smalley 2021-10-12 18:17:01 -07:00 committed by GitHub
parent c3b9e813c9
commit 690c25112c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -130,7 +130,7 @@ export class CiStatsReporter {
}
try {
const { stdout } = await execa('git', ['branch', '--show-current']);
const { stdout } = await execa('git', ['rev-parse', '--abbrev-ref', 'HEAD']);
branch = stdout;
} catch (e) {
this.log.debug(e.message);

View file

@ -9075,7 +9075,7 @@ class CiStatsReporter {
try {
const {
stdout
} = await (0, _execa.default)('git', ['branch', '--show-current']);
} = await (0, _execa.default)('git', ['rev-parse', '--abbrev-ref', 'HEAD']);
branch = stdout;
} catch (e) {
this.log.debug(e.message);