@@ -16,7 +16,7 @@ defaults:
1616jobs :
1717 runDataUpdate :
1818 if : github.ref == 'refs/heads/main'
19- name : Run Data Update
19+ name : Run Main Data Update
2020 runs-on : ubuntu-latest
2121 env :
2222 REPO_DIR : main
@@ -109,7 +109,7 @@ jobs:
109109 git pull --ff-only
110110 git stash pop
111111 git add -A .
112- git commit -m "$TIMESTAMP Data Update by ${{ steps.app-token.outputs.app-slug }}"
112+ git commit -m "$TIMESTAMP Main Data Update by ${{ steps.app-token.outputs.app-slug }}"
113113 git push
114114
115115 - name : Show health stats
@@ -126,9 +126,105 @@ jobs:
126126 if : ${{ always() }}
127127 uses : actions/upload-artifact@v7
128128 with :
129- name : logfiles_${{ env.TIMESTAMP }}_update
129+ name : logfiles_${{ env.TIMESTAMP }}_main_update
130130 path : |
131131 ${{ env.REPO_DIR }}/_visualize/LAST_MEMBERS_UPDATE.txt
132132 ${{ env.REPO_DIR }}/_visualize/LAST_MEMBERS_UPDATE.log
133133 ${{ env.REPO_DIR }}/_visualize/LAST_CORE_UPDATE.txt
134134 ${{ env.REPO_DIR }}/_visualize/LAST_CORE_UPDATE.log
135+
136+ runDataUpdateSlow :
137+ needs : runDataUpdate
138+ name : Run Activity Data Update (SLOW)
139+ runs-on : ubuntu-latest
140+ env :
141+ REPO_DIR : main
142+ TIMESTAMP : X
143+ steps :
144+ - name : Store timestamp
145+ run : |
146+ echo "TIMESTAMP=$(date -u +"%F-%H")" >> "$GITHUB_ENV"
147+
148+ - name : Checkout
149+ uses : actions/checkout@v6
150+ with :
151+ path : ${{ env.REPO_DIR }}
152+ token : ${{ secrets.GITHUB_TOKEN }}
153+ persist-credentials : false
154+
155+ - name : Setup python
156+ uses : actions/setup-python@v6
157+ with :
158+ python-version : ' 3.11'
159+ cache : ' pip'
160+ cache-dependency-path : ' ${{ env.REPO_DIR }}/_visualize/scripts/requirements.txt'
161+
162+ - name : Install dependencies
163+ run : pip install -r $REPO_DIR/_visualize/scripts/requirements.txt
164+
165+ - name : Run data collection script with Action Token
166+ run : |
167+ set -eu
168+ cd $REPO_DIR/_visualize/scripts
169+ ./UPDATE.sh $TAG
170+ env :
171+ GITHUB_API_TOKEN : ${{ secrets.GITHUB_TOKEN }}
172+ TAG : SLOW
173+
174+ - name : Validate slow data updates
175+ run : ./$REPO_DIR/.github/scripts/validate.sh
176+ env :
177+ TAG : SLOW
178+
179+ - name : Create GitHub App Installation Token
180+ uses : actions/create-github-app-token@v3
181+ id : app-token
182+ with :
183+ client-id : ${{ vars.CLIENT_ID }}
184+ private-key : ${{ secrets.PRIVATE_KEY }}
185+
186+ - name : Get GitHub App User ID
187+ id : get-user-id
188+ env :
189+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
190+ run : echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
191+
192+ - name : Configure git
193+ env :
194+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
195+ run : |
196+ gh auth setup-git
197+ git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
198+ git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
199+
200+ - name : Commit updated data
201+ env :
202+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
203+ run : |
204+ set -eu
205+ cd $REPO_DIR
206+ git stash
207+ git pull --ff-only
208+ git stash pop
209+ git add -A .
210+ git commit -m "$TIMESTAMP Activity Data Update by ${{ steps.app-token.outputs.app-slug }}"
211+ git push
212+
213+ - name : Show health stats
214+ if : ${{ always() }}
215+ run : |
216+ for TAG in SLOW; do
217+ cat $REPO_DIR/_visualize/LAST_${TAG}_UPDATE.txt || true
218+ echo "Warning Count: $(grep -c 'Warning' $REPO_DIR/_visualize/LAST_${TAG}_UPDATE.log)"
219+ echo "From Timeouts: $(grep -c 'but failed' $REPO_DIR/_visualize/LAST_${TAG}_UPDATE.log)"
220+ echo "Limit Reached: $(grep -c 'rate limit exceeded' $REPO_DIR/_visualize/LAST_${TAG}_UPDATE.log)"
221+ done
222+
223+ - name : Save log files
224+ if : ${{ always() }}
225+ uses : actions/upload-artifact@v7
226+ with :
227+ name : logfiles_${{ env.TIMESTAMP }}_activity_update
228+ path : |
229+ ${{ env.REPO_DIR }}/_visualize/LAST_SLOW_UPDATE.txt
230+ ${{ env.REPO_DIR }}/_visualize/LAST_SLOW_UPDATE.log
0 commit comments