Skip to content

Commit 89f314d

Browse files
authored
Update updater.yml
1 parent f5f8313 commit 89f314d

File tree

1 file changed

+56
-51
lines changed

1 file changed

+56
-51
lines changed

.github/workflows/updater.yml

Lines changed: 56 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,91 +6,96 @@ on:
66
- cron: '0 1 * * *'
77

88
jobs:
9-
trigger_workflows:
9+
litecoin_updater:
1010
runs-on: ubuntu-latest
1111
steps:
12-
13-
# Run Dash Workflow
14-
- name: Trigger Litecoin
15-
uses: actions/github-script@v6
16-
with:
17-
script: |
18-
github.rest.actions.createWorkflowDispatch({
19-
owner: context.repo.owner,
20-
repo: context.repo.repo,
21-
workflow_id: 'dash_updater.yml',
22-
ref: context.ref,
23-
inputs: {
24-
logLevel: 'info'
25-
}
26-
});
27-
# Run Litecoin Workflow
28-
- name: Trigger Litecoin
12+
- name: Trigger Litecoin Updater
2913
uses: actions/github-script@v6
3014
with:
3115
script: |
3216
github.rest.actions.createWorkflowDispatch({
3317
owner: context.repo.owner,
3418
repo: context.repo.repo,
3519
workflow_id: 'litecoin_updater.yml',
36-
ref: context.ref,
37-
inputs: {
38-
logLevel: 'info'
39-
}
20+
ref: context.ref
4021
});
4122
42-
# Run Dogecoin Workflow
43-
- name: Trigger Dogecoin
23+
- name: Save Update Time
24+
run: echo "LITECOIN=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
25+
26+
dogecoin_updater:
27+
runs-on: ubuntu-latest
28+
needs: litecoin_updater
29+
steps:
30+
- name: Trigger Dogecoin Updater
4431
uses: actions/github-script@v6
4532
with:
4633
script: |
4734
github.rest.actions.createWorkflowDispatch({
4835
owner: context.repo.owner,
4936
repo: context.repo.repo,
5037
workflow_id: 'dogecoin_updater.yml',
51-
ref: context.ref,
52-
inputs: {
53-
logLevel: 'info'
54-
}
38+
ref: context.ref
5539
});
56-
57-
# Run Bitcoin Cash Workflow
58-
- name: Trigger Bitcoin
40+
41+
- name: Save Update Time
42+
run: echo "DOGECOIN=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
43+
44+
bitcoincash_updater:
45+
runs-on: ubuntu-latest
46+
needs: dogecoin_updater
47+
steps:
48+
- name: Trigger Bitcoin Cash Updater
5949
uses: actions/github-script@v6
6050
with:
6151
script: |
6252
github.rest.actions.createWorkflowDispatch({
6353
owner: context.repo.owner,
6454
repo: context.repo.repo,
6555
workflow_id: 'bitcoincash_updater.yml',
66-
ref: context.ref,
67-
inputs: {
68-
logLevel: 'info'
69-
}
56+
ref: context.ref
7057
});
71-
72-
# Run Bitcoin Workflow
73-
- name: Trigger Bitcoin
58+
59+
- name: Save Update Time
60+
run: echo "BITCOINCASH=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
61+
62+
bitcoin_updater:
63+
runs-on: ubuntu-latest
64+
needs: bitcoincash_updater
65+
steps:
66+
- name: Trigger Bitcoin Updater
7467
uses: actions/github-script@v6
7568
with:
7669
script: |
7770
github.rest.actions.createWorkflowDispatch({
7871
owner: context.repo.owner,
7972
repo: context.repo.repo,
8073
workflow_id: 'bitcoin_updater.yml',
81-
ref: context.ref,
82-
inputs: {
83-
logLevel: 'info'
84-
}
74+
ref: context.ref
8575
});
86-
87-
- name: Update Readme Index File
88-
run: envsubst < .github/README.template.md > README.md
8976
90-
- name: Update Repo
77+
- name: Save Update Time
78+
run: echo "BITCOIN=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
79+
80+
update_readme:
81+
runs-on: ubuntu-latest
82+
needs: bitcoin_updater
83+
steps:
84+
- name: Checkout Repository
85+
uses: actions/checkout@v3
86+
87+
- name: Replace Variables in README
88+
run: |
89+
export UPDATE_TIME_LITECOIN=${LITECOIN}
90+
export UPDATE_TIME_DOGECOIN=${DOGECOIN}
91+
export UPDATE_TIME_BITCOINCASH=${BITCOINCASH}
92+
export UPDATE_TIME=${BITCOIN}
93+
envsubst < .github/README.template.md > README.md
94+
95+
- name: Commit and Push Changes
9196
run: |
92-
git config --global user.name 'github-actions'
93-
git config --global user.email 'github-actions@github.com'
94-
git add README.md
95-
git commit -m 'Updated : ${{ env.UPDATE_TIME }}'
96-
git push origin main
97+
git config --global user.name 'github-actions'
98+
git config --global user.email 'github-actions@github.com'
99+
git add README.md
100+
git commit -m "Updated README with latest coin update times"
101+
git push origin main

0 commit comments

Comments
 (0)