Skip to content

Commit

Permalink
Update add-tags.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shestakoven authored Oct 29, 2024
1 parent ca750ec commit 0869481
Showing 1 changed file with 30 additions and 32 deletions.
62 changes: 30 additions & 32 deletions .github/workflows/add-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,36 @@ jobs:
# Loop over each directory and its corresponding URLs
for dir in "${!directories_and_urls[@]}"; do
# Merge JSON files in the directory
jq -s 'flatten' "$dir"/*.json > merged.json
# Check directory and upload merged file to the specific URLs
if [[ "$dir" == "tokens" ]]; then
curl -X 'POST' \
"${{ secrets.URL_1 }}" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected];type=application/json'
curl -X 'POST' \
"${{ secrets.URL_2 }}" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected];type=application/json'
elif [[ "$dir" == "accounts" ]]; then
curl -X 'POST' \
"${{ secrets.URL_3 }}" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected];type=application/json'
curl -X 'POST' \
"${{ secrets.URL_4 }}" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected];type=application/json'
fi
# Remove the merged file after processing
rm merged.json
# Iterate over each JSON file in the directory
for file in "$dir"/*.json; do
# Check directory and upload each file to the specific URLs
if [[ "$dir" == "tokens" ]]; then
curl -X 'POST' \
"${{ secrets.URL_1 }}" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F "file=@${file};type=application/json"
curl -X 'POST' \
"${{ secrets.URL_2 }}" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F "file=@${file};type=application/json"
elif [[ "$dir" == "accounts" ]]; then
curl -X 'POST' \
"${{ secrets.URL_3 }}" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F "file=@${file};type=application/json"
curl -X 'POST' \
"${{ secrets.URL_4 }}" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F "file=@${file};type=application/json"
fi
done
done

0 comments on commit 0869481

Please sign in to comment.