-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.47 KB
/
bctechdays.yml
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
41
name: bctechdays
on:
schedule:
- cron: "0 */6 * * *" # GitHub uses UTC
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install required PowerShell modules
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module UncommonSense.BcTechDays, UncommonSense.iCalendar -Scope CurrentUser
Get-Module -ListAvailable
- name: Update calendar file
shell: pwsh
run: |
Get-BcTechDaysSchedule
| ForEach-Object {
$Level = $_.Level ? " [$($_.Level)]" : '';
$Duration = $_.Duration ? "[$($_.Duration)]" : '';
$Speakers = $_.Speakers ? "`n`nSpeaker(s): $($_.Speakers -join ', ')" : '';
New-CalendarEvent -Start $_.StartDate -End $_.EndDate -Summary "$($_.Title)$($Level)$($Duration)" -Description "$($_.Description)$Speakers" -Location ($_.Location -join ', ')
} | Export-Calendar -Name 'BC TechDays' -Path ./data/bctechdays.ics
- name: Push changes to git repo
run: |
git config --global user.name 'Jan Hoek'
git config --global user.email 'github@uncommonsense.nl'
git remote set-url origin https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}
git pull
git add ./data/*
git commit -am 'Updated bctechdays files'|| echo "No changes to commit"
git push