mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 15:40:20 +00:00 
			
		
		
		
	Use process substitution as a solution for the subshell issue
This commit is contained in:
		
							parent
							
								
									dfe06c0747
								
							
						
					
					
						commit
						2d8913a772
					
				
							
								
								
									
										19
									
								
								.github/workflows/build-and-release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								.github/workflows/build-and-release.yml
									
									
									
									
										vendored
									
									
								
							@ -441,17 +441,11 @@ jobs:
 | 
				
			|||||||
          FORMATTED_VERSION: ${{ needs.read_metadata.outputs.formatted_version }}
 | 
					          FORMATTED_VERSION: ${{ needs.read_metadata.outputs.formatted_version }}
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          # Export the necessary variables for xargs:
 | 
					 | 
				
			||||||
          export GITHUB_WORKSPACE
 | 
					 | 
				
			||||||
          export FORMATTED_VERSION
 | 
					 | 
				
			||||||
          export platforms_json
 | 
					 | 
				
			||||||
          
 | 
					 | 
				
			||||||
          # Here, we create the JSON object:
 | 
					          # Here, we create the JSON object:
 | 
				
			||||||
          platforms_json=$(jq -n '{}')
 | 
					          platforms_json=$(jq -n '{}')
 | 
				
			||||||
          
 | 
					          
 | 
				
			||||||
          # Function to process each signature file
 | 
					          # Iterate over all signature files:
 | 
				
			||||||
          process_signature() {
 | 
					          while IFS= read -r -d '' sig_file; do
 | 
				
			||||||
            sig_file="$1"
 | 
					 | 
				
			||||||
          
 | 
					          
 | 
				
			||||||
            echo "Processing signature file '$sig_file':"
 | 
					            echo "Processing signature file '$sig_file':"
 | 
				
			||||||
          
 | 
					          
 | 
				
			||||||
@ -488,14 +482,7 @@ jobs:
 | 
				
			|||||||
            else
 | 
					            else
 | 
				
			||||||
                echo "   Error: Could not find the platform file for the signature file '$sig_file'."
 | 
					                echo "   Error: Could not find the platform file for the signature file '$sig_file'."
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
          }
 | 
					          done < <(find $GITHUB_WORKSPACE/artifacts -type f -name '*.sig' -print0)
 | 
				
			||||||
          
 | 
					 | 
				
			||||||
          # Export the function to make it available to xargs:
 | 
					 | 
				
			||||||
          export -f process_signature
 | 
					 | 
				
			||||||
          
 | 
					 | 
				
			||||||
          # Iterate over all signature files using find and xargs:
 | 
					 | 
				
			||||||
          find $GITHUB_WORKSPACE/artifacts -type f -name '*.sig' -print0 | xargs -0 -I {} bash -c 'process_signature "$@"' _ {}
 | 
					 | 
				
			||||||
          echo "Platforms JSON: '$platforms_json'"
 | 
					 | 
				
			||||||
          
 | 
					          
 | 
				
			||||||
          # Write the JSON object to a temporary file:
 | 
					          # Write the JSON object to a temporary file:
 | 
				
			||||||
          echo "$platforms_json" > $GITHUB_WORKSPACE/.updates/platforms.json
 | 
					          echo "$platforms_json" > $GITHUB_WORKSPACE/.updates/platforms.json
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user