Navigation Menu

Skip to content

Bash condition not working #27107

Discussion options

You must be logged in to vote

I did define differently before it’s a copy paste of my last try lol. @airtower-luna .

I finally made it work. For anyone who gets the same problem here is the solution:
We need to create a step before using the value of cluster_status and set it in an evironnement variable.
Then, I don’t know why and I hope someone clarifies this for us, it works by using it in another step.

    - name: Get AKS status
      run: |
          echo "cluster_status=$(az aks list | jq -c 'map(select(any(.name; contains("dev-aks")))|.powerState)[].code')" >> $GITHUB_ENV         
- name: Perform action
  run: |    
      if [[ ${{ env.cluster_status }} == "Stopped" && "${{ steps.set-action.outputs.actio…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants