Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 30, 2025

This pull request was created as a result of the following prompt in Copilot Chat.

Original prompt - submitted by @02ez

Edit .github/workflows/pr-summary.yml. In the "Write step summary" step, replace git diff calls with a robust git diff-tree approach. Fetch the base if missing, guard errors, and count changed files plus docs-only files matching ^content/.*.md$. Output both to $GITHUB_STEP_SUMMARY. Keep permissions/concurrency/timeout unchanged. Provide a commit suggestion patch only for that step.

Summary

This PR creates a new GitHub Actions workflow .github/workflows/pr-summary.yml that provides a robust file change summary for pull requests using git diff-tree instead of git diff.

Key Features

Robust Git Operations:

  • Uses git diff-tree --name-only --no-commit-id -r for reliable file change detection
  • Automatically fetches missing base commits with proper error handling
  • Guards against errors with explicit error checking and GitHub Actions error logging

File Change Analysis:

  • Counts total changed files across the entire repository
  • Specifically counts documentation files matching the pattern ^content/.*\.md$
  • Handles edge cases like empty diffs and missing commits gracefully

GitHub Actions Integration:

  • Outputs comprehensive markdown summary to $GITHUB_STEP_SUMMARY
  • Follows repository conventions for permissions (contents: read)
  • Uses standard concurrency control and timeout settings (10 minutes)
  • Triggers on pull_request events (opened and synchronized)

Example Output

The workflow generates a step summary that includes:

  • Summary statistics showing total changed files and documentation files
  • Complete list of all changed files in a code block
  • Filtered list of documentation files that match the content pattern

This provides maintainers and contributors with clear visibility into what files are being modified in each pull request, with special attention to documentation changes.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI assigned Copilot and 02ez Aug 30, 2025
@02ez 02ez marked this pull request as ready for review August 30, 2025 21:20
@Copilot Copilot AI review requested due to automatic review settings August 30, 2025 21:20
Copilot

This comment was marked as outdated.

@02ez 02ez requested a review from Copilot August 30, 2025 21:20
Copy link

@Copilot 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.

Copilot wasn't able to review any files in this pull request.

Copilot AI and others added 2 commits August 30, 2025 21:22
@Copilot Copilot AI changed the title [WIP] Edit .github/workflows/pr-summary.yml. In the “Write step summary” step, replace git diff calls with a robust git diff-tree approach. Fetch the base if missing, guard errors, and count changed files plus docs-only files matching ^content/.*\.md$. O... Create PR summary workflow with robust git diff-tree approach Aug 30, 2025
@Copilot Copilot AI requested a review from 02ez August 30, 2025 21:28
Copilot finished work on behalf of 02ez August 30, 2025 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants