π₯ Download RSS Feeds #239
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
# A GitHub Action to download RSS feeds from various sources | |
# Runs each night, used to populate my website's activity feed | |
name: π₯ Download RSS Feeds | |
on: | |
workflow_dispatch: # Manual dispatch | |
schedule: | |
- cron: '0 23 * * *' # At 23:00 each day | |
jobs: | |
download: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/[email protected] | |
- name: Get Date π | |
id: date | |
run: echo "::set-output name=date::$(date +'%d-%b-%Y')" | |
- name: Download Feeds π¬ | |
run: | | |
fetch_feed() { curl "${1}" --fail --connect-timeout 10 --max-time 15 --retry 3 --retry-delay 10 --retry-max-time 90 -o "${2}"; } | |
fetch_feed "https://github.com/khulnasoft.atom" "./github.atom" | |
- name: Commit βοΈ | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "khulnasoft-bot" | |
git add . | |
git commit -m "ποΈ Downloads RSS Feed - Updated on ${{ steps.date.outputs.date }}" | |
- name: Push β€΄οΈ | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |