{"id":27785991,"url":"https://github.com/fcrakib/pythonautomation2","last_synced_at":"2025-04-30T15:37:26.497Z","repository":{"id":290104362,"uuid":"973386920","full_name":"FcRakib/PythonAutomation2","owner":"FcRakib","description":"actions-bot-which-executes-a-python-script-roughly-every-8-minutes-that-appends-information-to-a-text-file","archived":false,"fork":false,"pushed_at":"2025-04-26T21:55:05.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T15:37:26.314Z","etag":null,"topics":["github-actions","python-automation","workflow"],"latest_commit_sha":null,"homepage":null,"language":null,"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/FcRakib.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}},"created_at":"2025-04-26T21:54:56.000Z","updated_at":"2025-04-26T21:55:08.000Z","dependencies_parsed_at":"2025-04-26T22:29:02.204Z","dependency_job_id":"6efbd3ba-dad1-458b-8feb-0671aca65b6a","html_url":"https://github.com/FcRakib/PythonAutomation2","commit_stats":null,"previous_names":["fcrakib/pythonautomation2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FcRakib%2FPythonAutomation2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FcRakib%2FPythonAutomation2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FcRakib%2FPythonAutomation2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FcRakib%2FPythonAutomation2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FcRakib","download_url":"https://codeload.github.com/FcRakib/PythonAutomation2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251733068,"owners_count":21634892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["github-actions","python-automation","workflow"],"created_at":"2025-04-30T15:37:25.374Z","updated_at":"2025-04-30T15:37:26.483Z","avatar_url":"https://github.com/FcRakib.png","language":null,"readme":"---\r\n\r\n# Python Automation with GitHub Actions\r\n\r\nThis project demonstrates the use of GitHub Actions to automate the execution of a Python script at regular intervals. The script appends random values along with the current date and time (when the code was executed) to a text file named `useless_info.txt`, and commits the changes to the repository.\r\n\r\n---\r\n\r\n## Table of Contents\r\n1. [Overview](#overview)\r\n2. [Features](#features)\r\n3. [Getting Started](#getting-started)\r\n4. [Workflow Details](#workflow-details)\r\n5. [Contributing](#contributing)\r\n7. [License](#license)\r\n\r\n---\r\n\r\n## Overview\r\n\r\nThis repository contains a GitHub Actions workflow that automates the execution of a Python script whenever possible. Scheduled workflows can run as frequently as every 5 minutes, but actual execution timing may vary depending on GitHub's servers.\r\n\r\n### Script Functions:\r\n- Checks if a file named `useless_info.txt` exists; if it doesn’t, the script creates it.\r\n- Appends a random value to the file.\r\n- Appends the current date and time to the file.\r\n- Commits the changes to the repository using GitHub Actions.\r\n\r\n**Note**: If using a **self-hosted GitHub Actions runner**, you will need to install dependencies manually on the runner (see [Self-Hosted Runner Setup](#self-hosted-runner-setup)).\r\n\r\n---\r\n\r\n## Features\r\n\r\n- **Automated Execution**: Runs the Python script at regular intervals using GitHub Actions.\r\n- **Data Logging**: Logs random values along with timestamps to a text file, showcasing file handling and automation.\r\n- **Continuous Integration**: Automatically commits and pushes changes, demonstrating CI capabilities with GitHub Actions.\r\n\r\n---\r\n\r\n## Getting Started\r\n\r\n### Installation\r\n\r\n1. **Fork the Repository**  \r\n   Click the 'Fork' button at the top right corner of this repository to create a copy under your GitHub account.\r\n\r\n2. **Clone the Repository**  \r\n   Clone the forked repository to your local machine:\r\n   ```bash\r\n   git clone https://github.com/your-username/PythonAutomation2.git\r\n   ```\r\n\r\n3. **Navigate to the Project Directory**  \r\n   ```bash\r\n   cd PythonAutomation2\r\n   ```\r\n\r\n4. **Install Dependencies**  \r\n   - **For GitHub's Hosted Actions**: Dependencies are automatically installed as part of the workflow, so you don't need to install them locally.\r\n   - **For Self-Hosted GitHub Actions Runners**: You will need to manually install the required Python packages on your self-hosted runner:\r\n   ```bash\r\n   pip install -r requirements.txt\r\n   ```\r\n   **Note**: The `requests` package in `requirements.txt` is **not used** in the actual code but is included for demonstration purposes. You can remove it from `requirements.txt` if it is not needed for your setup.\r\n\r\n---\r\n\r\n## Workflow Details\r\n\r\nThe GitHub Actions workflow is defined in `.github/workflows/main.yml` and is scheduled to run whenever possible. Scheduled workflows can run as frequently as every 5 minutes, but actual execution timing may vary depending on GitHub's servers. The workflow executes the following steps:\r\n\r\n1. **Set Up Python Environment**  \r\n   Initializes a Python environment with the specified version.\r\n\r\n2. **Install Dependencies**  \r\n   Installs the Python packages listed in `requirements.txt`.\r\n\r\n3. **Run Python Script**  \r\n   Executes `main.py` to check for or create the text file, append data, and log timestamps.\r\n\r\n4. **Commit and Push Changes**  \r\n   Commits any changes made to `useless_info.txt` and pushes them to the repository.\r\n\r\nFor more details, refer to the `main.yml` file in the `.github/workflows` directory.\r\n\r\n---\r\n\r\n## Contributing\r\n\r\nContributions are welcome! To contribute, please follow these steps:\r\n\r\n1. **Fork the Repository**  \r\n   Create a fork of this repository.\r\n\r\n2. **Create a Feature Branch**  \r\n   Create a new branch for your feature or bug fix:\r\n   ```bash\r\n   git checkout -b feature-name\r\n   ```\r\n\r\n3. **Commit Your Changes**  \r\n   Make your changes and commit them with clear, descriptive messages:\r\n   ```bash\r\n   git commit -m \"Description of your changes\"\r\n   ```\r\n\r\n4. **Push to Your Branch**  \r\n   Push your changes to your forked repository:\r\n   ```bash\r\n   git push origin feature-name\r\n   ```\r\n\r\n5. **Create a Pull Request**  \r\n   Open a pull request to this repository, detailing the changes you made.\r\n\r\n---\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the `LICENSE` file for more details.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcrakib%2Fpythonautomation2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffcrakib%2Fpythonautomation2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcrakib%2Fpythonautomation2/lists"}