Skip to content

Commit 8081e33

Browse files
author
github-actions
committed
build: 25e17b253cc1cf5f8fc7448304c0c37eb4488bc6
1 parent a08217e commit 8081e33

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/workflows/reusable.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,13 @@ jobs:
4646
# git pull --allow-unrelated-histories prod main || echo "Git pull failed"
4747
# git push prod main --force
4848

49-
49+
- name: Update README with repository links
50+
run: ./build/update-readme.sh
51+
52+
- name: Commit and push changes
53+
run: |
54+
git config --local user.email "[email protected]"
55+
git config --local user.name "GitHub Action"
56+
git add README.md
57+
git commit -m "Update README with exchange repository links" || echo "No changes to commit"
58+
git push

build/update-readme.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Define array of exchanges
4+
EXCHANGES=("binance" "kucoin" "coinbase" "kraken" "bybit")
5+
6+
# Create the section content in a variable
7+
SECTION=$'\n## Exchange Repositories\n\n'
8+
9+
# Generate links for each exchange
10+
for exchange in "${EXCHANGES[@]}"; do
11+
SECTION+="- [python-${exchange}](https://github.com/ccxt/python-${exchange}.git)"$'\n'
12+
done
13+
14+
# Update README with perl (no temp files)
15+
perl -i -0pe "s/## Exchange Repositories.*?(^##|\Z)/$SECTION\$1/ms" README.md || {
16+
# If section doesn't exist, append it
17+
echo "$SECTION" >> README.md
18+
}
19+
20+
# Display the changes
21+
cat README.md

0 commit comments

Comments
 (0)