1
1
name : Detect changes in documentation within nginx/nginx.org
2
2
3
3
on :
4
- pull_request :
5
- # workflow_dispatch:
6
- # schedule:
7
- # - cron: "0 */23 * * *"
4
+ schedule :
5
+ - cron : " 0 */23 * * *"
8
6
permissions :
7
+ contents : write
9
8
pull-requests : write
9
+ issues : write
10
10
11
11
jobs :
12
12
detect-changes :
@@ -15,10 +15,14 @@ jobs:
15
15
outputs :
16
16
IS_CHANGES_DETECTED : ${{ steps.check_changes.outputs.changed }}
17
17
steps :
18
+ - name : Checkout Repository
19
+ uses : actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
20
+ with :
21
+ fetch-depth : 0
18
22
- name : Clone the nginx/nginx-org repository
19
23
run : |
20
24
git clone --depth=2 https://github.com/nginx/nginx.org.git dot-org-repo
21
- - name : Change for changes in xml/en folder
25
+ - name : Check for changes in xml/en folder
22
26
id : check_changes
23
27
run : |
24
28
cd dot-org-repo
@@ -32,66 +36,20 @@ jobs:
32
36
echo "No changes in /en"
33
37
echo "changed=false" >> $GITHUB_OUTPUT
34
38
fi
35
-
36
39
- name : Execute make target 'make hugo-md' to generate markdown
37
40
if : steps.check_changes.outputs.changed == 'true'
38
41
run : |
39
42
cd dot-org-repo
40
43
make module-markdown
41
-
42
- move-generated-files :
43
- name : Move generated markdown files to '/content/nginx' directory
44
- if : needs.detect-changes.outputs.IS_CHANGES_DETECTED
45
- needs : detect-changes
46
- runs-on : ubuntu-latest
47
- steps :
48
- - name : Move the generated folder
49
- run : |
50
- mv dot-org-repo/libxslt-md/ ./content/nginx/
51
-
52
- close-stale-PRs :
53
- name : Close any related stale PRs
54
- needs : move-generated-files
55
- runs-on : ubuntu-latest
56
- steps :
57
- - name : Check for any stale PRs
58
- id : check-stale-pr
59
- run : |
60
- "PLACEHOLDER"
61
-
62
- - name : Close relevant PR if any exists
63
- if : steps.check-stale-pr.outputs.IS_STALE_FOUND == 'true'
64
- run : |
65
- "PLACEHOLDER"
66
-
67
-
68
- create-PR :
69
- name : Create PR in documentation repository
70
- if : needs.detect-changes.outputs.IS_CHANGES_DETECTED
71
- needs : close-stale-PRs
72
- runs-on : ubuntu-latest
73
- steps :
74
- - name : Generate the PR
75
- uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
44
+ - name : Create PR
45
+ uses : peter-evans/create-pull-request@v7
46
+ if : steps.check_changes.outputs.changed == 'true'
76
47
with :
77
- script : |
78
- const { repo, owner } = context.repo;
79
-
80
- const result = await github.rest.pulls.create({
81
- title: 'NGINX Plus - Module Ref: Update content for content/nginx due to detected changes',
82
- owner,
83
- repo,
84
- head: '${{ github.ref_name }}',
85
- base: 'develop',
86
- body: [
87
- '### Proposed Changes',
88
- 'Updated NGINX Plus docs',
89
- ].join('\n')
90
- });
91
-
92
- github.rest.issues.addLabels({
93
- owner,
94
- repo,
95
- issue_number: result.data.number,
96
- labels: ['product/nginx-plus', 'dependencies', 'module-reference']
97
- });
48
+ commit-message : " chore: Update nginx plus module reference from detected changes in nginx/nginx.org"
49
+ labels : product/nginx-plus, dependencies, module-reference
50
+ base : main
51
+ branch : update-nginx-module-ref
52
+ title : ' NGINX Plus - Module Ref: Update content for content/nginx due to detected changes'
53
+ body : |
54
+ ### Proposed Changes
55
+ Updated NGINX Plus docs.
0 commit comments