Commit 38b11435 authored by Cédric OLIVIER's avatar Cédric OLIVIER
Browse files

fix: only launch tests job on code update

parent 4943fd6a
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -585,8 +585,12 @@ tf-tfsec:
    # on any branch: when $TFSEC_ENABLED is set
    # on production or integration branches: auto
    - if: '$TF_TFSEC_ENABLED == "true" && ($CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF)'
      changes:  
        - $TF_PROJECT_DIR/*
    # else (development branches): allow failure
    - if: '$TF_TFSEC_ENABLED == "true"'
      changes:  
        - $TF_PROJECT_DIR/*
      allow_failure: true

tf-tflint:
@@ -615,6 +619,8 @@ tf-tflint:
    - if: '$CI_MERGE_REQUEST_ID || $TF_TFLINT_DISABLED == "true"'
      when: never
    - if: $CI_COMMIT_REF_NAME  # useless but prevents GitLab from warning
      changes:  
        - $TF_PROJECT_DIR/*


tf-checkov:
@@ -644,8 +650,12 @@ tf-checkov:
    # on any branch: when $TF_CHECKOV_ENABLED is set
    # on production or integration branches: auto
    - if: '$TF_CHECKOV_ENABLED == "true" && ($CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF)'
      changes:  
        - $TF_PROJECT_DIR/*    
    # else (development branches): allow failure
    - if: '$TF_CHECKOV_ENABLED == "true"'
      changes:  
        - $TF_PROJECT_DIR/*
      allow_failure: true

tf-infracost:
@@ -666,8 +676,12 @@ tf-infracost:
    # on any branch: when $TF_INFRACOST_ENABLED is set
    # on production or integration branches: auto
    - if: '$TF_INFRACOST_ENABLED == "true" && ($CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF)'
      changes:  
        - $TF_PROJECT_DIR/*
    # else (development branches): allow failure
    - if: '$TF_INFRACOST_ENABLED == "true"'
      changes:  
        - $TF_PROJECT_DIR/*
      allow_failure: true