diff --git a/.github/workflows/functionnal_tests.yml b/.github/workflows/functionnal_tests.yml index 383ddf3e..b4327861 100644 --- a/.github/workflows/functionnal_tests.yml +++ b/.github/workflows/functionnal_tests.yml @@ -33,6 +33,7 @@ jobs: branch=$(echo ${{github.ref}} | sed -r 's/.+\/(.+)/\1/') echo "Branch name: $branch" export GITHUB_BRANCH=$branch + export GITHUB_COMMIT_ID=$GITHUB_SHA gh_json=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/Qovery/engine/pulls?state=open") gh_pr=$(echo $gh_json | jq --compact-output '.[] | {labels, ref: .head.ref}' | awk "/$branch/") echo "Pull request info: $(echo $gh_pr)" diff --git a/helper.sh b/helper.sh index cf20612a..51d46916 100755 --- a/helper.sh +++ b/helper.sh @@ -25,7 +25,7 @@ function run_tests() { GITLAB_REF="dev" echo "Requesting Gitlab pipeline" - pipeline_id=$(curl -s -X POST -F "token=$GITLAB_TOKEN" -F "ref=$GITLAB_REF" -F "variables[GITHUB_ENGINE_BRANCH_NAME]=$GITHUB_BRANCH" -F "variables[TESTS_TYPE]=$TESTS_TYPE" https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/trigger/pipeline | jq --raw-output '.id') + pipeline_id=$(curl -s -X POST -F "token=$GITLAB_TOKEN" -F "ref=$GITLAB_REF" -F "variables[GITHUB_COMMIT_ID]=$GITHUB_COMMIT_ID" -F "variables[GITHUB_ENGINE_BRANCH_NAME]=$GITHUB_BRANCH" -F "variables[TESTS_TYPE]=$TESTS_TYPE" https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/trigger/pipeline | jq --raw-output '.id') if [ $(echo $pipeline_id | egrep -c '^[0-9]+$') -eq 0 ] ; then echo "Pipeline ID is not correct, we expected a number and got: $pipeline_id" exit 1