From 551e358eb4361134941db307e4352117d31ce93a Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Sun, 20 Dec 2020 16:39:37 -0500 Subject: [PATCH] Do merge sha work for Azure as it runs detached head --- SHA1SUM | 2 +- SHA256SUM | 2 +- SHA512SUM | 2 +- codecov | 18 ++++++++++++++++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/SHA1SUM b/SHA1SUM index d794356d..78d60a0d 100644 --- a/SHA1SUM +++ b/SHA1SUM @@ -1 +1 @@ -a0a6a995c0344a91f842d706be0ce382198f9c3e codecov +48ad4d9f3dfd0dd194804c8b7207f03cdcc7e94f codecov diff --git a/SHA256SUM b/SHA256SUM index 938f7830..17ccdf19 100644 --- a/SHA256SUM +++ b/SHA256SUM @@ -1 +1 @@ -6b3a7a4dc3ba8bdaa12b1341cddc310b780d5e9eb1ef51d240c8ada352a763fa codecov +4792a0946df31cd69770156f3172f9ca1c3c318c5c9ab8bb5846eed2987cf77e codecov diff --git a/SHA512SUM b/SHA512SUM index 69ffac97..0771ad6d 100644 --- a/SHA512SUM +++ b/SHA512SUM @@ -1 +1 @@ -08c2e1854c0c45fcfcfb8923c5b2799d8cf252f0b75e590dbac1a70506a93688ee1b4dc4c96846575224c58b1e362d0ebb1bcebf163c38cb93bd65484ae9b3bc codecov +f665ab465163bbc54a86b1e46b7cdbdaaba31044f09570ed74891666e53a810fb732dbaaca3c414609f30be6c284a1d9ec017def43ea171b550d3c3eeb3d2c41 codecov diff --git a/codecov b/codecov index 4e25fd61..cbf2cbe2 100755 --- a/codecov +++ b/codecov @@ -846,8 +846,9 @@ then fi if [[ "$mc" =~ ^[a-z0-9]{40}[[:space:]][a-z0-9]{40}$ ]]; then - say " Fixing merge commit SHA" - commit=$(echo "$mc" | cut -d' ' -f2) + mc=$(echo "$mc" | cut -d' ' -f2) + say " Fixing merge commit SHA $commit -> $mc" + commit=$mc fi elif [ "$SYSTEM_TEAMFOUNDATIONSERVERURI" != "" ]; @@ -870,6 +871,19 @@ then branch="${BUILD_SOURCEBRANCH#"refs/heads/"}" build_url=$(urlencode "${SYSTEM_TEAMFOUNDATIONSERVERURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}") + # azure/pipelines runs in detached HEAD + mc= + if [ -n "$pr" ] && [ "$pr" != false ]; + then + mc=$(git show --no-patch --format="%P" 2>/dev/null || echo "") + fi + if [[ "$mc" =~ ^[a-z0-9]{40}[[:space:]][a-z0-9]{40}$ ]]; + then + mc=$(echo "$mc" | cut -d' ' -f2) + say " Fixing merge commit SHA $commit -> $mc" + commit=$mc + fi + elif [ "$CI" = "true" ] && [ "$BITBUCKET_BUILD_NUMBER" != "" ]; then say "$e==>$x Bitbucket detected."