Monitor Exchange Inbox #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Monitor Exchange Inbox | |
on: | |
schedule: | |
# Runs every hour (at the top of the hour) | |
- cron: "0 * * * *" | |
workflow_dispatch: # Allows manual triggering of the workflow | |
inputs: | |
interval: | |
description: "Polling interval in seconds" | |
required: false | |
default: "3600" | |
jobs: | |
monitor-inbox: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
# Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install exchangelib PyGitHub | |
- name: Set Git user name and email | |
run: | | |
git config --global user.name "Labot" | |
git config --global user.email "[email protected]" | |
git config --global url.https://github.com/.insteadOf git://github.com/ | |
# Run the Python script | |
- name: Run Monitor Script | |
env: | |
EMAIL: ${{ secrets.EXCHANGE_EMAIL }} | |
PASSWORD: ${{ secrets.EXCHANGE_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.MY_PAT_TOKEN }} | |
run: | | |
python labot/monitor_email.py |