AnandChowdhary/birthday-reminders-action
- November 1, 2022
- View on GitHub
- JavaScript
- 8 stars
- 8 watchers
- 2 forks
Get daily Telegram messages for birthday reminders using GitHub Actions.
🎈 How it works
Using scheduled workflows, you will receive a Telegram message once every day with a list of birthdays, and once every week with upcoming birthdays you should order gifts for.
🛠️ Setup
Create a new repository with the following environment variables:
TELEGRAM_TOKEN
- Bot tokenTELEGRAM_CHAT_ID
- Chat ID
Next, create a birthdays.yml
file with a list of birthdays you want to track:
- name: Anand Chowdhary
day: 29
month: 12
year: 1997
- name: Sukriti Kapoor
day: 15
month: 9
gift: true
Each person should have a “name” (string), “month” (number), and “day” (number). Optionally, you can add “year” (number) to find out how many years old they are, “gift” (boolean) for whether or not you want to be reminded to purchase a gift, and “me” (boolean) for a wish for yourself.
Then, create two GitHub Actions workflow files. First, .github/workflows/daily.yml
:
name: Daily CI
on:
schedule:
- cron: “0 8 * * *”
workflow_dispatch:
jobs:
weekly:
name: Daily birthday reminders
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2.3.3
- name: Send message
uses: AnandChowdhary/birthday-reminders-action@HEAD
with:
command: birthdays-today
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
- name: Keep alive
uses: gautamkrishnar/keepalive-workflow@v1
In the above example, we’ve also included gautamkrishnar/keepalive-workflow to prevent GitHub from disabling scheduled workflows.
And .github/workflows/weekly.yml
:
name: Weekly CI
on:
schedule:
- cron: “0 8 * * 1”
workflow_dispatch:
jobs:
weekly:
name: Weekly birthday reminders
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2.3.3
- name: Send message
uses: AnandChowdhary/birthday-reminders-action@HEAD
with:
command: upcoming-birthdays
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
You can manually trigger the workflow to test it out.
📄 License
- Code: MIT © Anand Chowdhary
- “GitHub” is a trademark of GitHub, Inc.