-
-
Save KyMidd/ac00363df2687c3f4bbc0e2e683cd78a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: Specify pods to deploy using regex ${{ github.event.inputs.pod-selection-regex }} | |
| id: set-targeted-pods | |
| run: | | |
| # Read TF apply workfile as var | |
| WORKFILE=$(cat ./.github/workflows/tf-deploy.yml) | |
| # Get all targateable pods from workflow file | |
| ALL_PODS=$(echo "$WORKFILE" | yq .on.workflow_dispatch.inputs.location.options | cut -d " " -f 2) | |
| # If pod-selection-regex set to wildcard, select all pods | |
| if [[ ${{ github.event.inputs.pod-selection-regex }} == "*" ]]; then | |
| echo "Wildcard used to select all pods, selecting all pods" | |
| TARGETED_PODS=$ALL_PODS | |
| else | |
| echo "Wildcard not used to select all pods, selecting pods using regex" | |
| TARGETED_PODS=$(echo "$ALL_PODS" | grep -E "${{ github.event.inputs.pod-selection-regex }}" ) | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment