Skip to content

Commit bef41ba

Browse files
feat: Add workflow to detect changes in dot org (#854)
* feat: Add new workflow for detecting changes in dot org * Refactor to use a new dep for making PR * Use better change comparision command to detect changes * Added paths to git add the generated files + yaml --------- Co-authored-by: Michael McKeen <[email protected]>
1 parent bb9796b commit bef41ba

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/dot-org-content.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Detect changes in documentation within nginx/nginx.org
2+
3+
on:
4+
schedule:
5+
- cron: "0 */23 * * *"
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
issues: write
10+
11+
jobs:
12+
detect-changes:
13+
name: Detect changes in 'en' docs of nginx/nginx.org
14+
runs-on: ubuntu-latest
15+
outputs:
16+
IS_CHANGES_DETECTED: ${{ steps.check_changes.outputs.changed }}
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
20+
with:
21+
fetch-depth: 0
22+
- name: Clone the nginx/nginx-org repository
23+
run: |
24+
git clone --depth=2 https://github.com/nginx/nginx.org.git dot-org-repo
25+
- name: Check for changes in xml/en folder
26+
id: check_changes
27+
run: |
28+
cd dot-org-repo
29+
30+
if git whatchanged --since="1 day ago" -- _xml/en/; then
31+
echo "Changes detected in /en"
32+
echo "changed=true" >> $GITHUB_OUTPUT
33+
else
34+
echo "No changes in /en"
35+
echo "changed=false" >> $GITHUB_OUTPUT
36+
fi
37+
- name: Execute make target 'make hugo-md' to generate markdown
38+
if: steps.check_changes.outputs.changed == 'true'
39+
run: |
40+
cd dot-org-repo
41+
make module-markdown
42+
- name: Create PR
43+
uses: peter-evans/create-pull-request@v7
44+
if: steps.check_changes.outputs.changed == 'true'
45+
with:
46+
commit-message: "chore: Update nginx plus module reference from detected changes in nginx/nginx.org"
47+
labels: product/nginx-plus, dependencies, module-reference
48+
base: main
49+
branch: update-nginx-module-ref
50+
title: 'NGINX Plus - Module Ref: Update content for content/nginx due to detected changes'
51+
add-paths: |
52+
dot-org-repo/libxslt-md/
53+
dot-org-repo/yaml/nginx_api.yaml
54+
body: |
55+
### Proposed Changes
56+
Updated NGINX Plus docs.

0 commit comments

Comments
 (0)