Skip to content

bctechdays

bctechdays #1321

Workflow file for this run

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