-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (64 loc) · 2.74 KB
/
sync-docs-content.yml
File metadata and controls
74 lines (64 loc) · 2.74 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Sync Documentation Content
on:
# Runs when docs are updated
push:
branches: [main]
paths:
- 'docs/**'
- 'resources/**'
- 'README.md'
# Allows manual trigger
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
sync-content:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for content updates
id: check_updates
run: |
echo "Checking for documentation updates that need to be reflected in the website..."
# This workflow can be extended to update specific sections of the HTML files
# based on changes in the documentation
# For now, we'll create a summary of what changed
if git diff --name-only HEAD~1 HEAD | grep -E "(docs/|resources/|README.md)"; then
echo "updates_found=true" >> $GITHUB_OUTPUT
else
echo "updates_found=false" >> $GITHUB_OUTPUT
fi
- name: Create update summary
if: steps.check_updates.outputs.updates_found == 'true'
run: |
# Create a summary of documentation changes
echo "# Documentation Updates" > update_summary.md
echo "" >> update_summary.md
echo "The following documentation files have been updated:" >> update_summary.md
echo "" >> update_summary.md
git diff --name-only HEAD~1 HEAD | grep -E "(docs/|resources/|README.md)" >> update_summary.md
echo "" >> update_summary.md
echo "Please review these changes and update the corresponding HTML pages in the website directory if needed." >> update_summary.md
- name: Create PR with update notification
if: steps.check_updates.outputs.updates_found == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: documentation updates notification'
title: 'Documentation Updates - Website Review Needed'
body: |
Documentation has been updated in the repository. Please review the changes and update the corresponding HTML pages in the website directory if needed.
## Updated Files
See the update_summary.md file for a list of changed documentation files.
## Action Required
- Review the documentation changes
- Update the corresponding HTML pages in the website directory
- Ensure consistency between documentation and website content
branch: docs-update-notification-${{ github.run_number }}
delete-branch: true
add-paths: |
update_summary.md