From eefcab600fc97fd8b5dd284a5b9578d13b2baf70 Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Mon, 12 Aug 2024 12:03:46 +0200 Subject: [PATCH 1/7] another bash check --- .github/workflows/ci_bundle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci_bundle.yml b/.github/workflows/ci_bundle.yml index 93c10a39..73f181c2 100644 --- a/.github/workflows/ci_bundle.yml +++ b/.github/workflows/ci_bundle.yml @@ -16,6 +16,9 @@ jobs: - name: compute tag name shell: bash run: | + echo git log --pretty="%p" -n 1 + echo git log --pretty="%h" -n 1 + echo $([[ $(git log --pretty="%p" -n 1 | wc -w) -gt 1 ]] && echo "PR 1" || echo "regular push 1") echo $([[ $(git log --pretty="%p" -n 1 | wc -w) -gt 1 ]] \ && echo "PR" \ || echo "regular push") From 7a745c8b5f6b0a66bbb89b83d9680b57f30e03b8 Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Mon, 12 Aug 2024 12:05:39 +0200 Subject: [PATCH 2/7] unecho --- .github/workflows/ci_bundle.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci_bundle.yml b/.github/workflows/ci_bundle.yml index 73f181c2..b6b9cf38 100644 --- a/.github/workflows/ci_bundle.yml +++ b/.github/workflows/ci_bundle.yml @@ -16,8 +16,7 @@ jobs: - name: compute tag name shell: bash run: | - echo git log --pretty="%p" -n 1 - echo git log --pretty="%h" -n 1 + git log --pretty="%p" -n 1 echo $([[ $(git log --pretty="%p" -n 1 | wc -w) -gt 1 ]] && echo "PR 1" || echo "regular push 1") echo $([[ $(git log --pretty="%p" -n 1 | wc -w) -gt 1 ]] \ && echo "PR" \ From f58de2fb7ef9f9bcc6b517c5f64dfa770069ec83 Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Mon, 12 Aug 2024 12:11:12 +0200 Subject: [PATCH 3/7] echo variants --- .github/workflows/ci_bundle.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci_bundle.yml b/.github/workflows/ci_bundle.yml index b6b9cf38..ac4d0b5b 100644 --- a/.github/workflows/ci_bundle.yml +++ b/.github/workflows/ci_bundle.yml @@ -16,6 +16,14 @@ jobs: - name: compute tag name shell: bash run: | + git log --pretty="%h" -n 1 + git log -n 1 + git log --pretty=%P -1 --merges + git log --pretty=%P -1 --no-merges + git log --pretty="%p" -n 1 + git log -n 1 --pretty="%P" + git log -n 1 --pretty="%p" + git log -n 1 --pretty=%p git log --pretty="%p" -n 1 echo $([[ $(git log --pretty="%p" -n 1 | wc -w) -gt 1 ]] && echo "PR 1" || echo "regular push 1") echo $([[ $(git log --pretty="%p" -n 1 | wc -w) -gt 1 ]] \ From 743279f5f4fb0eb34a6c7e50fdf22b60ddb15e01 Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Mon, 12 Aug 2024 12:12:25 +0200 Subject: [PATCH 4/7] more echos --- .github/workflows/ci_bundle.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci_bundle.yml b/.github/workflows/ci_bundle.yml index ac4d0b5b..16f77821 100644 --- a/.github/workflows/ci_bundle.yml +++ b/.github/workflows/ci_bundle.yml @@ -18,6 +18,8 @@ jobs: run: | git log --pretty="%h" -n 1 git log -n 1 + git log -n 2 + git log -n 2 --parents git log --pretty=%P -1 --merges git log --pretty=%P -1 --no-merges git log --pretty="%p" -n 1 From 9eb4062adc3ad82adb48b9ae0f2c7615738b8380 Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Mon, 12 Aug 2024 12:33:15 +0200 Subject: [PATCH 5/7] checkout --- .github/workflows/ci_bundle.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci_bundle.yml b/.github/workflows/ci_bundle.yml index 16f77821..c9d9c120 100644 --- a/.github/workflows/ci_bundle.yml +++ b/.github/workflows/ci_bundle.yml @@ -13,6 +13,25 @@ jobs: steps: - name: checkout ${{ github.head_ref }} uses: actions/checkout@v4 + - name: temporize + shell: bash + run: | + git log -n 1 + git log -n 1 --parents + - name: temporize 2 + shell: bash + run: | + git log -n 1 + git log -n 1 --parents + - name: quit branch for detached head + shell: bash + run: | + git checkout $(git log -n 1 --pretty=%h) + - name: check + shell: bash + run: | + git log -n 1 + git log -n 1 --parents - name: compute tag name shell: bash run: | From ee90df0d943b7e183061dd4318c8cdfbcb28c37a Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Mon, 12 Aug 2024 12:44:06 +0200 Subject: [PATCH 6/7] check git version --- .github/workflows/ci_bundle.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_bundle.yml b/.github/workflows/ci_bundle.yml index c9d9c120..6393af21 100644 --- a/.github/workflows/ci_bundle.yml +++ b/.github/workflows/ci_bundle.yml @@ -13,6 +13,11 @@ jobs: steps: - name: checkout ${{ github.head_ref }} uses: actions/checkout@v4 + - name: check git + shell: bash + run: | + git version + git log --help | grep "%P" -C 5 - name: temporize shell: bash run: | @@ -26,7 +31,7 @@ jobs: - name: quit branch for detached head shell: bash run: | - git checkout $(git log -n 1 --pretty=%h) + git checkout cb5445b - name: check shell: bash run: | From 6b94e3437e148b9cdfde9cda21faf66c32f83656 Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Mon, 12 Aug 2024 13:00:40 +0200 Subject: [PATCH 7/7] deepen fetch to find parents --- .github/workflows/ci_bundle.yml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci_bundle.yml b/.github/workflows/ci_bundle.yml index 6393af21..d0ae444c 100644 --- a/.github/workflows/ci_bundle.yml +++ b/.github/workflows/ci_bundle.yml @@ -13,30 +13,15 @@ jobs: steps: - name: checkout ${{ github.head_ref }} uses: actions/checkout@v4 - - name: check git - shell: bash - run: | - git version - git log --help | grep "%P" -C 5 - - name: temporize - shell: bash - run: | - git log -n 1 - git log -n 1 --parents - - name: temporize 2 - shell: bash - run: | - git log -n 1 - git log -n 1 --parents - - name: quit branch for detached head - shell: bash - run: | - git checkout cb5445b + with: + # default depth is 1, but we need the parent refs + fetch-depth: 2 - name: check shell: bash run: | git log -n 1 git log -n 1 --parents + git log -n 1 --pretty=%p - name: compute tag name shell: bash run: |