❌ Update Kenya Hashtags #28 – GitHub Actions Commit Failure
๐ Workflow Summary
- Workflow File:
.github/workflows/update-kenya-tags.yml - Trigger:
cron: '0 */6 * * *'+workflow_dispatch - Job:
update-tags - Runner: Ubuntu 24.04.3 LTS
- Commit Ref:
e84848348deaa75aed3523796ed00656efe494c2
⚙️ Workflow Breakdown
name: Update Kenya Hashtags
on:
schedule:
- cron: '0 */6 * * *' # Every 6 hours
workflow_dispatch:
jobs:
update-tags:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Fetch live hashtags
run: |
curl -s https://trends24.in/kenya/ |
grep -oP '(?<=<a href="/topics/)[^"]+' |
sed 's/^/#/' |
head -n 10 > tags.txt
- name: Build kenya.json
run: |
echo '{' > data/kenya.json
echo ' "region": "kenya",' >> data/kenya.json
echo ' "tags": [' >> data/kenya.json
sed 's/^/ "/;s/$/",/' tags.txt >> data/kenya.json
echo ' ]' >> data/kenya.json
echo '}' >> data/kenya.json
- name: Commit and push
run: |
git config --global user.name "CivicBot"
git config --global user.email "civicbot@users.noreply.github.com"
git add data/kenya.json
git commit -m "Auto-update Kenya hashtags"
git push
❌ Error Diagnosis
Git output:
Untracked files: tags.txt
nothing added to commit but untracked files present
data/kenya.json but ignored tags.txt. Git refused to commit because no tracked files were added.
๐ ️ Civic Fix
Patch the commit step to include both files:
git add data/kenya.json tags.txtOr ignore tags.txt entirely if it’s not meant to be committed:
echo tags.txt >> .gitignore๐ง Final Notes
- CivicBot was authenticated and ready
- Live hashtags were fetched from
https://trends24.in/kenya/ - JSON was built successfully
- Commit failed due to untracked file logic