From 6f392c9435f73e83aaae4af62409e04ebb71d2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Wed, 15 Mar 2023 18:05:18 +0100 Subject: [PATCH] chore(ci): avoid using merge commit sha in pull request --- .github/workflows/start_slab.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/start_slab.yml b/.github/workflows/start_slab.yml index 3d20a96ed..102eb15d6 100644 --- a/.github/workflows/start_slab.yml +++ b/.github/workflows/start_slab.yml @@ -20,11 +20,16 @@ jobs: sl: runs-on: ubuntu-latest steps: + - name: Checkout concrete-open-source + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Get git ref # github.head_ref is only available from a Pull Request if: env.GIT_REF == '' run: | - echo "GIT_REF=${{ github.ref }}" >> $GITHUB_ENV + echo "GIT_REF=${{ github.ref_name }}" >> $GITHUB_ENV - name: Checkout Slab repo uses: actions/checkout@v3 @@ -35,9 +40,10 @@ jobs: - name: Start AWS job in Slab shell: bash - # TODO: step result must be correlated to HTTP return code. run: | - echo -n '{"command": "${{ inputs.command }}", "git_ref": "${{ env.GIT_REF }}", "sha": "${{ github.sha }}"}' > command.json + GIT_SHA="$(git --no-pager show -s --format="%H" origin/${{ env.GIT_REF }})" + echo -n '{"command": "compiler-cpu-build", "git_ref": "test-with-david", "sha":"'${GIT_SHA}'"}' > command.json + cat command.json SIGNATURE="$(slab/scripts/hmac_calculator.sh command.json '${{ secrets.JOB_SECRET }}')" curl -v -k \ --fail-with-body \