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