-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (32 loc) · 1.1 KB
/
cal-television.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Calendar - Television
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
env:
FILE_NAME: tv
SHEET_URL: https://docs.google.com/spreadsheets/d/e/2PACX-1vRSHv8hgaDlBLG_bgq2Q6bm-Qk3dCVZAlq0nfPzYpTTq3MrJLsv0N9jmLOJZ5YWhjkwcG8chbVE3Et_/pub?gid=1474486128&single=true&output=tsv&range=C2:C
jobs:
download-and-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download file
run: wget -O ${{ env.FILE_NAME }}.ics --accept tsv "${{ env.SHEET_URL }}"
- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Check for changes
id: changes
run: |
git add ${{ env.FILE_NAME }}.ics
git diff-index --quiet HEAD || echo "has_changes=true" >> $GITHUB_ENV
- name: Commit changes
if: env.has_changes == 'true'
run: |
git commit -m 'Updated Calendar'
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}