devabhishekpal commented on code in PR #6916:
URL: https://github.com/apache/ozone/pull/6916#discussion_r2787219256


##########
.github/workflows/ci.yml:
##########
@@ -124,6 +124,325 @@ jobs:
       with-coverage: ${{ fromJSON(needs.build-info.outputs.with-coverage) }}
     secrets: inherit
 
+  generate-config-doc:
+    needs:
+      - build-info
+      - build
+    # Allow running for any branch in forks for testing, but only master in 
apache/ozone
+    if: |
+      needs.build-info.outputs.needs-build == 'true' &&
+      (github.repository != 'apache/ozone' || (github.event_name == 'push' && 
github.ref_name == 'master'))
+    uses: ./.github/workflows/generate-config-doc.yml
+    with:
+      sha: ${{ needs.build-info.outputs.sha }}
+
+  update-ozone-config-doc:
+    needs:
+      - build-info
+      - generate-config-doc
+    # Run on master in apache/ozone, or any branch in forks for testing
+    # Skip automated commits (starting with [Auto]) to avoid loops
+    if: |
+      github.event_name == 'push' &&
+      !startsWith(github.event.head_commit.message, '[Auto]') &&
+      (github.repository == 'apache/ozone' && github.ref_name == 'master' ||
+       github.repository != 'apache/ozone')
+    runs-on: ubuntu-24.04
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ github.sha }}
+          token: ${{ secrets.GITHUB_TOKEN }}
+      
+      - name: Extract JIRA ID from commit message
+        id: extract-jira-early
+        run: |
+          COMMIT_MSG=$(git log -1 --format='%s' ${{ github.sha }})
+          echo "Commit message: $COMMIT_MSG"
+          
+          JIRA_ID=$(echo "$COMMIT_MSG" | grep -oE '(HDDS|OZONE)-[0-9]+' | head 
-1 || echo "")
+          
+          if [ -n "$JIRA_ID" ]; then
+            echo "jira_id=$JIRA_ID" >> $GITHUB_OUTPUT
+            echo "Using JIRA ID: $JIRA_ID"
+          else
+            echo "jira_id=" >> $GITHUB_OUTPUT
+            echo "No JIRA ID found"
+          fi
+      
+      - name: Checkout project for documentation update
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ github.repository == 'apache/ozone' && github.ref_name == 
'master' && needs.build-info.outputs.sha || 'master' }}
+          token: ${{ secrets.GITHUB_TOKEN }}
+      
+      - name: Download generated documentation
+        uses: actions/download-artifact@v4
+        with:
+          name: config-documentation
+          path: .
+      
+      - name: Check if documentation changed
+        id: check-changes
+        run: |
+          # Move downloaded file to correct location
+          TARGET_FILE="hadoop-hdds/docs/content/tools/Configurations.md"
+          mv Configurations.md "$TARGET_FILE"
+          
+          # Check if file changed using git status
+          # This works whether the file is tracked, untracked, or modified
+          if git status --porcelain "$TARGET_FILE" | grep -q .; then
+            echo "changed=true" >> $GITHUB_OUTPUT
+            echo "Configurations.md has changed"
+          else
+            echo "changed=false" >> $GITHUB_OUTPUT
+            echo "No changes in Configurations.md"
+          fi
+      
+      - name: Commit and push changes
+        if: steps.check-changes.outputs.changed == 'true'
+        run: |
+          git config user.name 'github-actions[bot]'
+          git config user.email 'github-actions[bot]@users.noreply.github.com'
+          
+          # Use single branch name for all automated updates
+          BRANCH_NAME="automated-config-doc-update"
+          JIRA_ID="${{ steps.extract-jira-early.outputs.jira_id }}"
+          
+          # Create/reset branch at current commit
+          git checkout -B "$BRANCH_NAME"
+          echo "Created/reset branch $BRANCH_NAME at current commit"
+          
+          git add hadoop-hdds/docs/content/tools/Configurations.md

Review Comment:
   Same here, I think we can skip this if we are going to update only the new 
website content



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to