Skip to content

Commit 85140c9

Browse files
committed
Added Chromium step
1 parent 26cdca4 commit 85140c9

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/update-usercount-shields-weekly.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,34 +83,45 @@ jobs:
8383
echo "Edge users: $edge_users"
8484
8585
# Sum user counts
86-
total_users=$((chrome_users + edge_users))
86+
chromium_users=$((chrome_users + edge_users))
87+
total_users=$((chromium_users + ff_users))
88+
echo -e "\n-----\nTotal Chromium users: $chromium_users\n-----\n"
8789
echo -e "\n-----\nTotal users: $total_users\n-----\n"
8890
89-
# Format total
91+
# Format totals
92+
formatted_chromium_users=$(format_total "$chromium_users")
9093
formatted_total_users=$(format_total "$total_users")
94+
echo "Formatted Chromium users: $formatted_chromium_users"
9195
echo "Formatted total users: $formatted_total_users"
9296
9397
# Expose total for update step next
98+
echo "CHROMIUM_USERS=$formatted_chromium_users" >> $GITHUB_ENV
9499
echo "TOTAL_USERS=$formatted_total_users" >> $GITHUB_ENV
95100
96101
- name: Update README shields
97102
run: |
98-
cd ${{ github.workspace }}/adamlui/perplexity-omnibox
99-
TOTAL_USERS="${{ env.TOTAL_USERS }}"
103+
cd ${{ github.workspace }}/adamlui/deepseek-omnibox
104+
CHROMIUM_USERS="${{ env.CHROMIUM_USERS }}" TOTAL_USERS="${{ env.TOTAL_USERS }}"
100105
if [ "$TOTAL_USERS" == "0" ] ; then echo "Error getting total usercount"
101106
else # perform update
107+
users_updated=false
102108
for readme in $(find docs/ -name "README.md") ; do
103109
old_readme=$(<"$readme")
104110
sed -i "s/\(badge\/[^-]*-\)[0-9.,km+]\+-/\1$TOTAL_USERS-/gI" "$readme"
105111
new_readme=$(<"$readme")
106-
if [[ "$old_readme" != "$new_readme" && "$users_updated" != true ]]
107-
then users_updated=true ; fi
112+
if [[ "$old_readme" != "$new_readme" ]] ; then users_updated=true ; fi
113+
done
114+
for readme in $(find chromium/docs/ -name "README.md") ; do
115+
old_readme=$(<"$readme")
116+
sed -i "s/\(badge\/[^-]*-\)[0-9.,km+]\+-/\1$CHROMIUM_USERS-/gI" "$readme"
117+
new_readme=$(<"$readme")
118+
if [[ "$old_readme" != "$new_readme" ]] ; then users_updated=true ; fi
108119
done
109-
if [ "$users_updated" = true ] ; then echo "Usercount shields updated to $TOTAL_USERS"
120+
if [ "$users_updated" = true ] ; then echo "Usercount shields updated"
110121
else echo "Usercount shields already up-to-date" ; fi
111122
fi
112123
113-
# Set Updated flag to check in subseuqent steps
124+
# Set Updated flag to check in subsequent steps
114125
if [ "$users_updated" = true ] ; then echo "USERS_UPDATED=true" >> $GITHUB_ENV ; fi
115126
116127
- name: Sync ** to adamlui/ai-web-extensions/perplexity-omnibox/

0 commit comments

Comments
 (0)