-
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (45 loc) · 1.39 KB
/
update-ai-pulse.yml
File metadata and controls
55 lines (45 loc) · 1.39 KB
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
50
51
52
53
54
55
name: AI-Pulse Auto Aggregator
on:
schedule:
- cron: '0 */6 * * *' # Every 6 hours
push:
branches:
- main
workflow_dispatch: # Manual trigger
permissions:
contents: write
jobs:
aggregate-and-post:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
npm install axios cheerio rss-parser @octokit/rest
- name: Aggregate AI and Cybersecurity articles
env:
LINKEDIN_CLIENT_ID: ${{ secrets.LINKEDIN_CLIENT_ID }}
LINKEDIN_CLIENT_SECRET: ${{ secrets.LINKEDIN_CLIENT_SECRET }}
LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }}
run: |
node src/aggregator.js | tee NEW-README.md
- name: Update README with new content
run: |
rm -rf README.md && mv NEW-README.md README.md
- name: Commit and push changes
run: |
git config --global user.name 'ThePhoenixAgency'
git config --global user.email 'phoenix.project@outlook.fr'
git add .
if ! git diff --cached --exit-code; then
UTC_DATE=$(date -u +'%a %b %d %H:%M:%S UTC %Y')
git commit -m "Updated AI-Pulse: $UTC_DATE"
git push
else
echo "No changes to commit"
fi