Skip to content

confluence-scraper #338

confluence-scraper

confluence-scraper #338

Workflow file for this run

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 }}