{"id":31642177,"url":"https://github.com/4uffin/daily-count","last_synced_at":"2026-04-28T23:39:19.234Z","repository":{"id":317784324,"uuid":"1066878350","full_name":"4uffin/daily-count","owner":"4uffin","description":"A simple, self-managing system to automatically track a daily streak or continuous counter. Using Python and GitHub Actions.","archived":false,"fork":false,"pushed_at":"2026-04-28T15:33:12.000Z","size":145,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T23:38:46.006Z","etag":null,"topics":["actions","automated","automated-testing","automation","daily-tracker","experiment","github","github-actions","python","python3","yaml","yml"],"latest_commit_sha":null,"homepage":"https://4uffin.github.io/daily-count/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4uffin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-30T04:54:07.000Z","updated_at":"2026-04-28T15:41:32.000Z","dependencies_parsed_at":"2025-10-03T03:22:53.345Z","dependency_job_id":"8ab7ce97-b894-4f43-b22b-4ab7aafdb220","html_url":"https://github.com/4uffin/daily-count","commit_stats":null,"previous_names":["4uffin/daily-count"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/4uffin/daily-count","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4uffin%2Fdaily-count","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4uffin%2Fdaily-count/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4uffin%2Fdaily-count/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4uffin%2Fdaily-count/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4uffin","download_url":"https://codeload.github.com/4uffin/daily-count/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4uffin%2Fdaily-count/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32404340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","automated","automated-testing","automation","daily-tracker","experiment","github","github-actions","python","python3","yaml","yml"],"created_at":"2025-10-07T03:56:59.471Z","updated_at":"2026-04-28T23:39:19.192Z","avatar_url":"https://github.com/4uffin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub repo size](https://img.shields.io/github/repo-size/4uffin/daily-count)\n[![GitHub Actions](https://img.shields.io/badge/GitHub%20Actions-Automated-brightgreen)](https://github.com/features/actions)\n[![Python](https://img.shields.io/badge/Python-3.12+-blue.svg)](https://www.python.org/downloads/)\n\n![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n\n# **📅 Automated Daily Log Tracker**\n\nThis repository contains a simple, self-managing system to automatically track a daily streak or continuous counter. It runs once per day using **GitHub Actions**, executes a Python script to calculate the current day count, and commits a new, timestamped log file back to the repository.\n\nThe resulting files are named with the format: ```Day-X_YYYY-MM-DD.txt```.\n\n## **📂 Project Structure**\n\n```\n├── .github/  \n│   └── workflows/  \n│       └── daily_run.yml    # GitHub Action configuration  \n├── daily_logs/              # Automated output folder  \n│   └── Day-1_2025-09-29.txt  \n│   └── Day-2_2025-09-30.txt  \n└── daily_counter.py         # The core Python logic\n```\n\n## **🚀 Setup and Installation**\n\nFollow these steps to deploy the tracker in your own GitHub repository.\n\n### **1. Repository Preparation**\n\n1. **Create Repository:** Start a new GitHub repository.  \n2. **Add Files:** Add the ```daily_counter.py``` script and the ```.github/workflows/daily_run.yml``` file to the root of your repository.  \n3. **(Optional but Recommended):** Create the empty directory ```daily_logs``` locally and add a placeholder file (e.g., ```.gitkeep```) to ensure the directory is tracked by Git, though the Python script will create it if needed.\n\n### **2. GitHub Action Configuration**\n\nThe GitHub Action is configured to run automatically, but you must ensure it has the necessary permissions to commit the files.\n\n**No additional secrets are needed.** The action uses the built-in ```GITHUB_TOKEN``` which already has the permissions required by the workflow file ```(permissions: contents: write)```.\n\n### **3. Execution Schedule**\n\nThe workflow is currently scheduled to run every day at **midnight UTC** ```(0 0 * * *)```.\n\nIf you want to manually trigger the first run or test the process:\n\n1. Go to the **Actions** tab in your repository.  \n2. Select the **Daily Log Creator** workflow.  \n3. Click the **Run workflow** dropdown and select the ```main``` branch.\n\n## **⚙️ How It Works**\n\nThe system ensures **idempotence** (it won't create duplicate files if run multiple times in one day).\n\n1. **Daily Trigger:** GitHub runs the ```daily_run.yml``` job at the scheduled time.  \n2. **Count Calculation:** ```daily_counter.py``` looks inside the ```daily_logs/``` folder and counts all existing ```.txt``` files. This count is used to determine the sequential **Day-X** number.  \n3. **Duplicate Check:** The script generates the expected filename (e.g., ```Day-15_2026-03-05.txt```) and checks if it already exists.  \n   * **If file exists:** The script exits with a ```non-zero exit code (1)```, and the commit step is skipped.  \n   * **If file is new:** The script creates the file and exits with a ```zero exit code (0)```.  \n4. **Commit:** The GitHub Action sees the ```success status (0)```, stages the new file ```(git add daily_logs/*.txt)```, commits it, and pushes the change to the ```main``` branch.\n\n## **🐍 Python Dependencies**\n\nThe core logic relies solely on the Python Standard Library.\n\n| Module | Purpose |\n| :---- | :---- |\n| ```datetime``` | Used to get the current date ```(YYYY-MM-DD)```. |\n| ```pathlib``` | Used for reliable, cross-platform file and directory manipulation. |\n| ```os```, ```sys``` | Used for interacting with the system exit codes (crucial for GitHub Actions). |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4uffin%2Fdaily-count","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4uffin%2Fdaily-count","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4uffin%2Fdaily-count/lists"}