https://github.com/iflycn/autogreen
Auto Green - A commit a day keeps your girlfriend away
https://github.com/iflycn/autogreen
actions yaml
Last synced: 12 months ago
JSON representation
Auto Green - A commit a day keeps your girlfriend away
- Host: GitHub
- URL: https://github.com/iflycn/autogreen
- Owner: iflycn
- License: mit
- Created: 2021-02-10T20:03:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-07-09T01:54:36.000Z (12 months ago)
- Last Synced: 2025-07-09T02:48:28.142Z (12 months ago)
- Topics: actions, yaml
- Homepage:
- Size: 105 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Auto Green
A commit a day keeps your girlfriend away.
## GitHub Actions
### YAML
YAML is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted.
``` yaml
name: Auto-Green
on:
workflow_dispatch:
inputs:
log:
description: "Commit Log"
required: true
default: "a commit a day keeps your girlfriend away"
schedule:
- cron: "0 0 * * 0-5"
jobs:
autogreen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Pull
run: |
git config --local user.name "${{ github.actor }}"
git config --local user.email "${{ github.actor }}@gmail.com"
git remote set-url origin https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git pull --rebase
- name: Commit (default)
if: github.event.inputs.log == 0
run: git commit --allow-empty -m "a commit a day keeps your girlfriend away"
- name: Commit (input)
if: github.event.inputs.log != 0
run: git commit --allow-empty -m "${{ github.event.inputs.log }}"
- name: Push
run: git push
```
### Manual Event
Use the `workflow_dispatch` event to manually trigger workflow runs. When the workflow runs, access the input values in the `github.event.inputs` context.
### Scheduled Event
Use the `schedule` event to trigger a workflow at a scheduled time. Cron syntax has five fields separated by a space, and each field represents a unit of time.
```
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of the month (1 - 31)
│ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
│ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
* * * * *
```
You can use [crontab guru](https://crontab.guru/) to help generate your cron syntax and confirm what time it will run.
## GitHub Docs
- [https://docs.github.com/en/actions](https://docs.github.com/en/actions)