88permissions :
99 pull-requests : write
1010
11+ env :
12+ FEATURE_BRANCH_NAME : nginx-module-ref-auto-update
13+
1114jobs :
1215 detect-changes :
1316 name : Detect changes in 'en' docs of nginx/nginx.org
1417 runs-on : ubuntu-latest
1518 outputs :
1619 IS_CHANGES_DETECTED : ${{ steps.check_changes.outputs.changed }}
1720 steps :
21+ - name : Checkout Repository
22+ uses : actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
23+ with :
24+ fetch-depth : 0
1825 - name : Clone the nginx/nginx-org repository
1926 run : |
2027 git clone --depth=2 https://github.com/nginx/nginx.org.git dot-org-repo
21- - name : Change for changes in xml/en folder
28+ - name : Check for changes in xml/en folder
2229 id : check_changes
2330 run : |
2431 cd dot-org-repo
@@ -36,62 +43,20 @@ jobs:
3643 - name : Execute make target 'make hugo-md' to generate markdown
3744 if : steps.check_changes.outputs.changed == 'true'
3845 run : |
39- cd dot-org-repo
40- 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-
46+ git branch ${{ env.FEATURE_BRANCH_NAME }}
47+ git checkout ${{ env.FEATURE_BRANCH_NAME }}
48+ echo "DUMMY" >> new-file.txt
6749
6850 create-PR :
6951 name : Create PR in documentation repository
70- if : needs.detect-changes.outputs.IS_CHANGES_DETECTED
71- needs : close-stale-PRs
7252 runs-on : ubuntu-latest
7353 steps :
74- - name : Generate the PR
75- uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
54+ - name : Checkout Repository
55+ uses : actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
7656 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- });
57+ fetch-depth : 0
58+ - name : Generate the PR
59+ run : |
60+ gh pr create -B main -H ${{ env.FEATURE_BRANCH_NAME }} --title 'Merge branch_to_merge into base_branch' --body 'Created by Github action'
61+ env :
62+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments