ditbenik #75
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: ditbenik | |
on: | |
schedule: | |
- cron: "36 5 * * 5" | |
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.Hap, UncommonSense.Nrc, UncommonSense.Rss -Scope CurrentUser | |
- name: Get Recent data | |
shell: pwsh | |
run: | | |
Get-DitBenIk | |
| Select-Object -First 10 | |
| ForEach-Object { | |
New-RssFeedItem ` | |
-ID $_.Url ` | |
-Title $_.Title ` | |
-Description ((($_.Body | ForEach-Object { $_.Trim()} | Where-Object {$_} | ForEach-Object { "<p>$($_)</p>"}) -join "`n") + "`n<img src='$($_.Image)'/>") ` | |
-PubDate $_.Date } | |
| New-RssFeed ` | |
-Title 'Dit ben ik' ` | |
-Link 'https://www.nrc.nl/rubriek/dit-ben-ik/' ` | |
-Description 'Dit ben ik' | |
| Set-Content -Path ./data/ditbenik.xml | |
- name: Commit and push feed | |
shell: bash | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git pull | |
git add . | |
git commit -m "generated" || echo "No changes to commit" | |
git push |