From 30745f5ff7354df6bbc7aba154e87bb12e8ddf15 Mon Sep 17 00:00:00 2001 From: Elodie Billiot Date: Tue, 16 Jan 2024 17:08:05 +0100 Subject: [PATCH] fix: validate tag var --- .github/workflows/integration-cd.yml | 3 +-- .github/workflows/preproduction-cd.yml | 7 ++++++- .github/workflows/production-cd.yml | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration-cd.yml b/.github/workflows/integration-cd.yml index 782c7dd..08dc652 100644 --- a/.github/workflows/integration-cd.yml +++ b/.github/workflows/integration-cd.yml @@ -40,5 +40,4 @@ jobs: repo: PrestaShopCorp/qanightlyresults-cd inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "bulle": "${{ steps.get_bulle.outputs.BULLE }}", "project": "nightly", "repository": "PrestaShop/nightly-board", "tag": "${{ steps.get_tag.outputs.TAG }}"}' token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }} - # ref: 'refs/heads/main' - ref: 'refs/heads/fix/ci-deployment' \ No newline at end of file + ref: 'refs/heads/main' \ No newline at end of file diff --git a/.github/workflows/preproduction-cd.yml b/.github/workflows/preproduction-cd.yml index f31ff59..7a6abaa 100644 --- a/.github/workflows/preproduction-cd.yml +++ b/.github/workflows/preproduction-cd.yml @@ -20,11 +20,16 @@ jobs: id: branch uses: tj-actions/branch-names@v7.0.7 + - name: Get tag + shell: bash + id: get_tag + run: echo TAG=$PREFIX_TAG$(echo $GITHUB_REF | cut -d / -f 3) >> $GITHUB_OUTPUT + - name: Trigger CI / CD uses: aurelien-baudet/workflow-dispatch@v2 with: workflow: preproduction-cd.yml repo: PrestaShopCorp/qanightlyresults-cd - inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "project": "nightly", "repository": "PrestaShop/nightly-board", "commit": "$GITHUB_SHA"}' + inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "project": "nightly", "repository": "PrestaShop/nightly-board", "tag": "${{ steps.get_tag.outputs.TAG }}"}' token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }} ref: 'refs/heads/main' diff --git a/.github/workflows/production-cd.yml b/.github/workflows/production-cd.yml index 0930432..9dd41bb 100644 --- a/.github/workflows/production-cd.yml +++ b/.github/workflows/production-cd.yml @@ -19,11 +19,16 @@ jobs: id: branch uses: tj-actions/branch-names@v7.0.7 + - name: Get tag + shell: bash + id: get_tag + run: echo TAG=$PREFIX_TAG$(echo $GITHUB_REF | cut -d / -f 3) >> $GITHUB_OUTPUT + - name: Trigger CI / CD uses: aurelien-baudet/workflow-dispatch@v2 with: workflow: production-cd.yml repo: PrestaShopCorp/qanightlyresults-cd - inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "project": "nightly", "repository": "PrestaShop/nightly-board", "commit": "$GITHUB_SHA"}' + inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "project": "nightly", "repository": "PrestaShop/nightly-board", "tag": "${{ steps.get_tag.outputs.TAG }}"}' token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }} ref: 'refs/heads/main' \ No newline at end of file