Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
shestakoven committed Nov 5, 2024
2 parents 8e7c62a + 0869481 commit 0714098
Showing 1 changed file with 38 additions and 30 deletions.
68 changes: 38 additions & 30 deletions .github/workflows/add-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,44 @@ jobs:
- uses: actions/checkout@v3
- name: update tags
run: |
jq -s 'flatten' tokens/*.json > merged.json;
# Define directories and their corresponding URLs explicitly
declare -A directories_and_urls=(
["tokens"]="URL_1 URL_2"
["accounts"]="URL_3 URL_4"
)
# Loop over each directory and its corresponding URLs
for dir in "${!directories_and_urls[@]}"; do
# 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
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'
rm merged.json;
jq -s 'flatten' accounts/*.json > merged.json;
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'
rm merged.json;

0 comments on commit 0714098

Please sign in to comment.