mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 11:59:48 +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 }}
|
||||
|
||||
run: |
|
||||
# Export the necessary variables for xargs:
|
||||
export GITHUB_WORKSPACE
|
||||
export FORMATTED_VERSION
|
||||
export platforms_json
|
||||
|
||||
# Here, we create the JSON object:
|
||||
platforms_json=$(jq -n '{}')
|
||||
|
||||
# Function to process each signature file
|
||||
process_signature() {
|
||||
sig_file="$1"
|
||||
# Iterate over all signature files:
|
||||
while IFS= read -r -d '' sig_file; do
|
||||
|
||||
echo "Processing signature file '$sig_file':"
|
||||
|
||||
@ -488,14 +482,7 @@ jobs:
|
||||
else
|
||||
echo " Error: Could not find the platform file for the signature file '$sig_file'."
|
||||
fi
|
||||
}
|
||||
|
||||
# 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'"
|
||||
done < <(find $GITHUB_WORKSPACE/artifacts -type f -name '*.sig' -print0)
|
||||
|
||||
# Write the JSON object to a temporary file:
|
||||
echo "$platforms_json" > $GITHUB_WORKSPACE/.updates/platforms.json
|
||||
|
Loading…
Reference in New Issue
Block a user