Skip to content

Commit 59b990b

Browse files
authored
Update dash_updater.yml
1 parent 850266a commit 59b990b

1 file changed

Lines changed: 57 additions & 22 deletions

File tree

.github/workflows/dash_updater.yml

Lines changed: 57 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Dash Updater
22

33
on:
44
schedule:
5-
- cron: '15 1 * * *'
5+
- cron: '15 0 * * *'
66
workflow_dispatch:
77
inputs:
88
logLevel:
@@ -15,6 +15,13 @@ on:
1515
- warning
1616
- debug
1717

18+
concurrency:
19+
group: repo-main-push
20+
cancel-in-progress: false
21+
22+
permissions:
23+
contents: write
24+
1825
jobs:
1926
build:
2027
runs-on: self-hosted
@@ -24,12 +31,15 @@ jobs:
2431
steps:
2532
- name: Checkout repository
2633
id: checkout
27-
uses: actions/checkout@v2
28-
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
persist-credentials: true
38+
2939
- name: Set up Python 3.x
30-
uses: actions/setup-python@v2
40+
uses: actions/setup-python@v5
3141
with:
32-
python-version: 3.x
42+
python-version: '3.x'
3343

3444
- name: Install dependencies
3545
run: |
@@ -39,36 +49,37 @@ jobs:
3949
- name: Remove .gz files if they exist
4050
run: |
4151
if ls *.gz 1> /dev/null 2>&1; then
42-
rm -r *.gz
52+
rm -f *.gz
4353
else
4454
echo "No .gz files found, skipping removal."
4555
fi
4656
47-
4857
- name: Download Node Backup File Plugin [node_plugin.py]
49-
run: curl -o node_plugin.py ${{ secrets.NODE_PLUG }}
58+
run: curl -fsSL -o node_plugin.py ${{ secrets.NODE_PLUG }}
5059

5160
- name: Download Node Grabber [node_grab.py]
52-
run: curl -o node_grab.py ${{ secrets.NODE_ALT }}
61+
run: curl -fsSL -o node_grab.py ${{ secrets.NODE_ALT }}
5362

5463
- name: Set permissions for bump script
5564
run: chmod +x *.py
5665

5766
- name: Run Node Plugin
5867
env:
59-
CERT_FINGERPRINT: ${{ secrets.CERT_FINGERPRINT }}
60-
run: python3 node_plugin.py ${{ secrets.URL_DASH }}&&python3 node_grab.py Dash
68+
CERT_FINGERPRINT: ${{ secrets.CERT_FINGERPRINT }}
69+
run: |
70+
python3 node_plugin.py ${{ secrets.URL_DASH }}
71+
python3 node_grab.py Dash
6172
6273
- name: remove py file
63-
run: rm -r *.py
74+
run: rm -f *.py
6475

6576
- name: readme update
6677
run: |
6778
export COIN="Dash"
6879
export UPDATE_TIME="${{ env.UPDATE_TIME }}"
6980
export FILE_ALL_NAME="Latest_Dash_Addresses.tsv.gz"
70-
export FILE_ALL_SIZE="${{ env.Latest_Dash_Addresses_tsv_gz_size }}"
71-
export FILE_RICH_NAME="Latest_Rich_Dash_Addresses_txt_gz"
81+
export FILE_ALL_SIZE="${{ env.Latest_Dash_Addresses_tsv_gz_size }}"
82+
export FILE_RICH_NAME="Latest_Rich_Dash_Addresses.txt.gz"
7283
export FILE_RICH_SIZE="${{ env.Latest_Rich_Dash_Addresses_txt_gz_size }}"
7384
envsubst < .github/README.alt.template.md > DASH/README.md
7485
@@ -86,22 +97,20 @@ jobs:
8697
- Header tsv File : `address,balance`
8798
- Separator : `,`
8899
- Filter Minimum Balance for Rich File : `0.1 DASH`
89-
90-
> [!NOTE]
100+
101+
> [!NOTE]
91102
> Latest Update : `${{ env.UPDATE_TIME }}`
92103
93104
## Download `${{ env.UPDATE_TIME }}`
94105
95106
- [Latest_Dash_Addresses.tsv.gz](https://github.com/Pymmdrza/Rich-Address-Wallet/releases/download/Dash/Latest_Dash_Addresses.tsv.gz) : `${{ env.Latest_Dash_Addresses_tsv_gz_size }}`
96107
- [Latest_Rich_Dash_Addresses.txt.gz](https://github.com/Pymmdrza/Rich-Address-Wallet/releases/download/Dash/Latest_Rich_Dash_Addresses.txt.gz) : `${{ env.Latest_Rich_Dash_Addresses_txt_gz_size }}`
97108
98-
99-
### Donate
109+
### Donate
100110
101-
To support and appreciate us, you can send your gift in Bitcoin to the wallet address below. (Your donation will encourage us to continue this activity)
102-
103-
Bitcoin Wallet : `1MMDRZAcM6dzmdMUSV8pDdAPDFpwzve9Fc`
111+
To support and appreciate us, you can send your gift in Bitcoin to the wallet address below. (Your donation will encourage us to continue this activity)
104112
113+
Bitcoin Wallet : `1MMDRZAcM6dzmdMUSV8pDdAPDFpwzve9Fc`
105114
files: |
106115
${{ env.Latest_Dash_Addresses_tsv_gz }}
107116
${{ env.Latest_Rich_Dash_Addresses_txt_gz }}
@@ -110,6 +119,32 @@ jobs:
110119
run: |
111120
git config --global user.name 'github-actions'
112121
git config --global user.email 'github-actions@github.com'
122+
113123
git add DASH/README.md
124+
125+
if git diff --cached --quiet; then
126+
echo "No changes in DASH/README.md, nothing to commit."
127+
exit 0
128+
fi
129+
114130
git commit -m 'DASH Updated : ${{ env.UPDATE_TIME }}'
115-
git push origin main
131+
132+
for i in 1 2 3 4 5; do
133+
echo "Push attempt $i ..."
134+
git fetch origin main
135+
if ! git rebase origin/main; then
136+
echo "Rebase conflict, aborting and retrying."
137+
git rebase --abort || true
138+
sleep $((i * 5))
139+
continue
140+
fi
141+
if git push origin main; then
142+
echo "Pushed successfully."
143+
exit 0
144+
fi
145+
echo "Push rejected, retrying in $((i * 5))s ..."
146+
sleep $((i * 5))
147+
done
148+
149+
echo "Push failed after 5 attempts."
150+
exit 1

0 commit comments

Comments
 (0)