-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.7 KB
/
schedule.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
50
51
52
53
name: confluence-scraper
env:
CONFLUENCE_USER_NAME: ${{ secrets.CONFLUENCE_USER_NAME }}
CONFLUENCE_TOKEN: ${{ secrets.CONFLUENCE_TOKEN }}
BASE_URL: ${{ secrets.CONFLUENCE_URL }}
PAGES: "120392107,115081594,163422029,160074735,171770103"
on:
workflow_dispatch:
schedule:
# * is a special character in YAML, so you have to quote this string
- cron: '0 0 * * *'
jobs:
crud-confluenc:
name: Get and update contents from confluence
runs-on: ubuntu-24.04
defaults:
run:
working-directory: confluence-scraper
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Add Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: confluence-scraper/package-lock.json
- name: Install Dependencies
run: npm ci
- name: process script
id: confluence_script
run: |
node index.js
- name: Commit files # transfer the new html files back into the repository
if: steps.confluence_script.outputs.updated == 'true'
id: commit_push_pr
run: |
git config --global user.email "[email protected]"
git config --global user.name "Omprakash Mishra"
git checkout -b update/confluence-content
git add ../patterns
git commit -m "Adding or updating the confluence pages" || echo "No changes to commit"
git push origin update/confluence-content
gh pr create --assignee "mishraomp" --base main --title "Updated content from confluence." --body "Updated content from confluence."
env:
GH_TOKEN: ${{ secrets.PAT_GHA }}