{"id":19135562,"url":"https://github.com/sirwanafifi/mysql-actions","last_synced_at":"2025-10-17T03:57:49.081Z","repository":{"id":197662351,"uuid":"699080285","full_name":"SirwanAfifi/mysql-actions","owner":"SirwanAfifi","description":"MySQL Actions","archived":false,"fork":false,"pushed_at":"2023-10-02T20:00:08.000Z","size":11,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T14:35:25.282Z","etag":null,"topics":["actions","golang","mysql","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SirwanAfifi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-10-01T21:16:18.000Z","updated_at":"2023-10-03T10:59:16.000Z","dependencies_parsed_at":"2024-06-21T17:59:08.023Z","dependency_job_id":null,"html_url":"https://github.com/SirwanAfifi/mysql-actions","commit_stats":null,"previous_names":["sirwanafifi/mysql-actions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirwanAfifi%2Fmysql-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirwanAfifi%2Fmysql-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirwanAfifi%2Fmysql-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirwanAfifi%2Fmysql-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SirwanAfifi","download_url":"https://codeload.github.com/SirwanAfifi/mysql-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252755813,"owners_count":21799373,"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":["actions","golang","mysql","yaml"],"created_at":"2024-11-09T06:31:03.851Z","updated_at":"2025-10-17T03:57:44.043Z","avatar_url":"https://github.com/SirwanAfifi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MySQL Actions\n\nThis is a lot like GitHub Actions; Let's say you have a MySQL database with tables and you want something to happen when a new row is added, changed, or deleted, this is for you. For example, if you have a table of users and want a message to show up when a new user is inserted or deleted, you can set that up with a YAML file.\n\n```yaml\nname: Send Notification Example\n\non:\n  insert:\n    tables:\n      - users\n  delete:\n    tables:\n      - users\n\njobs:\n  - name: Send Notification\n    steps:\n      - name: Run send_notification.sh script\n        shell: bash\n        # run: ./send_notification.sh\n        run: |\n          echo \"Hello World\"\n```\n\nThis then prints \"Hello World\" when a new user is created or deleted.\n\n## Running\n\nMake sure you have a MySQL server running and you have set the these environment variables in a `.env` file:\n\n```bash\nMYSQL_USER=\nMYSQL_PASSWORD=\nMYSQL_HOST=\nMYSQL_DB=\n```\n\nThen run the following command to start the application:\n\n```bash\n\u003e go run ./cmd/mysql-actions/main.go\n```\n\n## How it works\n\nThe application basically uses MySQL triggers. Upon startup, it creates a table called `event_log` along with triggers for each table specified in the YAML file. When a row is either inserted or deleted from the tables, the corresponding trigger inserts a new record to the `event_log`. Subsequently, the application scans the `event_log` at regular intervals for new entries and executes the script delineated in the YAML file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirwanafifi%2Fmysql-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsirwanafifi%2Fmysql-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirwanafifi%2Fmysql-actions/lists"}