From 43e1c76b8134ca6b16d0626fdd09d2764a948885 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Tue, 11 Jun 2024 12:17:35 +0300 Subject: [PATCH] Trigger Update DB from selected branch instead of always hardcoding `main`! NOTE: use the commit hash b/c in GitLab branch names are different! Related: COMPOSER-2227 --- .github/workflows/auto_update.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto_update.yml b/.github/workflows/auto_update.yml index 926d2efb..b9186752 100644 --- a/.github/workflows/auto_update.yml +++ b/.github/workflows/auto_update.yml @@ -12,6 +12,13 @@ jobs: env: TRIGGER_TOKEN: ${{ secrets.TRIGGER_TOKEN }} steps: + - name: "Clone Repository" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.ref_name }} + - name: Trigger CI run: | - curl --request POST --form token=$TRIGGER_TOKEN --form ref=main https://gitlab.com/api/v4/projects/36844106/trigger/pipeline + COMMIT_HASH=$(git show HEAD | grep "^commit " | cut -f2 -d" ") + curl --request POST --form token=$TRIGGER_TOKEN --form ref=$COMMIT_HASH https://gitlab.com/api/v4/projects/36844106/trigger/pipeline