File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -88,16 +88,25 @@ runs:
8888 - name : Create kubeconfig file
8989 if : ${{ inputs.kubeconfig != '' }}
9090 run : |
91+ echo "Processing kubeconfig input..."
9192 mkdir -p ~/.kube
9293 if [[ "${{ inputs.kubeconfig }}" =~ ^(/|~|\.)/.*(\.yaml|\.yml|\.config)$ ]]; then
94+ echo "Input appears to be a file path: ${{ inputs.kubeconfig }}"
9395 # If input is a file path, copy it only if it's different from target
94- if [[ "${{ inputs.kubeconfig }}" != "$HOME/.kube/config" ]]; then
96+ input_path=$(realpath -m "${{ inputs.kubeconfig }}")
97+ target_path=$(realpath -m ~/.kube/config)
98+ if [[ "$input_path" != "$target_path" ]]; then
99+ echo "Copying kubeconfig from $input_path to $target_path"
95100 cp "${{ inputs.kubeconfig }}" ~/.kube/config
101+ else
102+ echo "Input path matches target path, skipping copy"
96103 fi
97104 else
105+ echo "Input appears to be direct kubeconfig content, writing to ~/.kube/config"
98106 # If input is the actual kubeconfig content, write it
99107 echo -e "${{ inputs.kubeconfig }}" > ~/.kube/config
100108 fi
109+ echo "Kubeconfig setup complete"
101110 shell : bash
102111
103112 - name : Set namespace
You can’t perform that action at this time.
0 commit comments