From 3d5c75cd72574942770b0e53e3a73457d09bc360 Mon Sep 17 00:00:00 2001 From: Adrian Riobo Lorenzo Date: Mon, 29 Apr 2024 13:05:32 +0200 Subject: [PATCH 1/3] CI: Github actions fix commit status on new PR On windows tester actions we are adding the status to the latest commit on a PR; to get the commit value we inspect the gh context but the condition to get the value on a new PR (.event.after is null) is not catch by the expression and so the .sha value is not picked; as so the status is not correctly added to the commit. This fix extends the condition to check for null values; and if that is the case pick the right commit value Signed-off-by: Adrian Riobo Lorenzo --- .github/workflows/windows-qe-tpl.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-qe-tpl.yml b/.github/workflows/windows-qe-tpl.yml index 1cd1e70169..e8f45b68cb 100644 --- a/.github/workflows/windows-qe-tpl.yml +++ b/.github/workflows/windows-qe-tpl.yml @@ -56,9 +56,9 @@ jobs: run: | # Get origin commit sha for testing commit_sha=$(cat gh_context.json | jq -r '.event.after') - if [[ -z "${commit_sha}" ]]; then + if [[ -z "${commit_sha}" ]] || [[ "${commit_sha}" == null ]]; then # on first PR creation .event.after is empty, then .sha is used as commit instead - commit_sha=$(cat gh_context.json | jq -r '.sha') + commit_sha=$(cat gh_context.json | jq -r '.event.pull_request.head.sha') fi echo "commit_sha=${commit_sha}" >> "$GITHUB_ENV" From cef9fee8a6d9e76753a8f85a58268a9ef8f73bcc Mon Sep 17 00:00:00 2001 From: Adrian Riobo Lorenzo Date: Mon, 29 Apr 2024 13:21:36 +0200 Subject: [PATCH 2/3] fake pr Signed-off-by: Adrian Riobo Lorenzo --- .github/workflows/windows-qe-tpl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-qe-tpl.yml b/.github/workflows/windows-qe-tpl.yml index e8f45b68cb..b90470e167 100644 --- a/.github/workflows/windows-qe-tpl.yml +++ b/.github/workflows/windows-qe-tpl.yml @@ -54,7 +54,7 @@ jobs: env: PULL_SECRET: ${{ secrets.PULL_SECRET }} run: | - # Get origin commit sha for testing + # Get origin commit sha for testinga commit_sha=$(cat gh_context.json | jq -r '.event.after') if [[ -z "${commit_sha}" ]] || [[ "${commit_sha}" == null ]]; then # on first PR creation .event.after is empty, then .sha is used as commit instead From 1a0af4b3cc425e8db214a2851a98f897092bbc65 Mon Sep 17 00:00:00 2001 From: Adrian Riobo Lorenzo Date: Mon, 29 Apr 2024 14:12:22 +0200 Subject: [PATCH 3/3] more test case Signed-off-by: Adrian Riobo Lorenzo --- .github/workflows/windows-qe-tpl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-qe-tpl.yml b/.github/workflows/windows-qe-tpl.yml index b90470e167..b71f4c4ae4 100644 --- a/.github/workflows/windows-qe-tpl.yml +++ b/.github/workflows/windows-qe-tpl.yml @@ -50,7 +50,7 @@ jobs: workflow: ${{inputs.trigger-workflow-id}} name: crc-${{inputs.qe-type}}-windows-amd64 - - name: Correlate + - name: Correlatea env: PULL_SECRET: ${{ secrets.PULL_SECRET }} run: |