Morning Mail: 01-16-2025 #180
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: Receive Morning Mail | |
on: | |
issues: | |
types: | |
- opened | |
jobs: | |
handle-issue: | |
permissions: | |
contents: write | |
issues: write | |
# Filter out non-email-generated issues | |
if: ${{ github.event.issue.user.login }} == "fire-bot" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
- name: Install pandoc and requirements | |
run: | | |
sudo apt-get install pandoc | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Save markdown and convert to html | |
env: | |
CONTENT: ${{ github.event.issue.body }} | |
run: | | |
echo "$CONTENT" > mm.md | |
pandoc --wrap=preserve mm.md -o mm.html | |
- name: Run HTML to RSS converter | |
run: | | |
python html_to_rss.py mm.html > morning-mail.rss | |
- name: Commit | |
run: | | |
git config user.name "Morning Mail" && git config user.email "[email protected]" | |
git add morning-mail.rss | |
git commit -m "$(date)" | |
git push | |
- name: Close issue | |
run: gh issue close "$NUMBER" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
NUMBER: ${{ github.event.issue.number }} |