-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.28 KB
/
tomgauld.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
42
43
44
45
46
47
48
49
name: tomgauld
on:
# push:
# branches:
# - master
schedule:
- cron: "35 6 * * 3"
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.NewScientist, UncommonSense.Rss -Scope CurrentUser
- name: Update feed
shell: pwsh
run: |
Get-TomGauld
| Select-Object -First 10
| ForEach-Object {
New-RssFeedItem `
-ID $_.Url `
-Title $_.Title `
-Description "<img src='$($_.Body)'/>" `
-PubDate $_.Date }
| New-RssFeed `
-Title 'Tom Gauld' `
-Link 'https://www.newscientist.com/author/tom-gauld/' `
-Description 'Tom Gauld'
| Set-Content -Path ./data/tomgauld.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