Skip to content

Conversation

@salihozkara
Copy link
Member

No description provided.

Replaces git diff logic with GitHub API to reliably detect added/modified markdown files in docs/en/ from merged PRs. Improves branch creation and file processing steps, ensuring only relevant files are handled for SEO updates.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the SEO workflow by replacing shell-based git diff operations with the GitHub API to detect changed markdown files in pull requests. The refactor improves reliability and maintainability by using actions/github-script to retrieve file changes with pagination support.

Key Changes:

  • Switched from git diff commands to GitHub REST API for detecting changed files
  • Added pagination support to handle PRs with more than 100 changed files
  • Simplified branch creation logic by checking out the base branch directly

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
ref: ${{ github.event.pull_request.base.ref }}
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking out the base branch will not include the merged changes from the PR. Since this workflow triggers on 'closed' with 'merged: true', you need the merged state. Consider using github.event.pull_request.merge_commit_sha or checking out the base branch and then merging/cherry-picking the PR changes.

Suggested change
ref: ${{ github.event.pull_request.base.ref }}
ref: ${{ github.event.pull_request.merge_commit_sha }}

Copilot uses AI. Check for mistakes.
Comment on lines +130 to +132
BRANCH_NAME="auto-docs-seo/${{ github.event.pull_request.number }}"
git commit -m "docs: Add SEO descriptions to modified documentation files" -m "Related to PR #${{ github.event.pull_request.number }}"
git push origin ${{ env.BRANCH_NAME }}
git push origin $BRANCH_NAME
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BRANCH_NAME variable is redefined here but was already set in the 'Create new branch for SEO updates' step (line 96) and exported to GITHUB_ENV. This duplication is unnecessary and could lead to inconsistencies if the naming pattern changes. Use ${{ env.BRANCH_NAME }} instead.

Copilot uses AI. Check for mistakes.
@maliming maliming merged commit 191b423 into dev Oct 21, 2025
2 checks passed
@maliming maliming deleted the salihozkara/seo branch October 21, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants