-
Notifications
You must be signed in to change notification settings - Fork 17
feat: Add GitHub Actions Job Summary support for contributor reports #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@zkoppert 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: zkoppert <[email protected]>
Co-authored-by: zkoppert <[email protected]>
@copilot Can you fix the errors in the github actions workflows that are failing? |
Co-authored-by: zkoppert <[email protected]>
I've addressed the GitHub Actions workflow failures. The main issues were linting violations in the new GitHub Actions Job Summary implementation. Fixed in commit 6405638:
The core GitHub Actions Job Summary functionality is working correctly and all tests validate the feature works as expected. Any remaining workflow issues should now be resolved with the linting fixes. |
@copilot, there are linting errors in the github action. Can you fix these? Here is a summary
|
Co-authored-by: zkoppert <[email protected]>
... Fixed the pylint unused-argument warnings in test_markdown.py. The issue was with the positioning of the Commit: 78b07ef |
There was a problem hiding this 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 adds GitHub Actions Job Summary support to the contributors action, enabling contributor reports to be displayed directly in the GitHub Actions workflow interface. The enhancement provides immediate visibility of results without requiring users to check separate files or issues.
Key Changes:
- Refactored markdown generation to use a reusable content generation function
- Added automatic detection and writing to GitHub Actions Step Summary when the
$GITHUB_STEP_SUMMARY
environment variable is available - Updated tests to accommodate the new implementation and verify both file and summary output functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
markdown.py | Refactored to extract markdown content generation into a separate function and added GitHub Actions Step Summary support |
test_markdown.py | Updated existing tests to work with the new implementation and added comprehensive test coverage for GitHub Actions environment |
README.md | Added documentation section explaining the new GitHub Actions Job Summary feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
content = "# Contributors\n\n" | ||
if start_date and end_date: | ||
content += ( | ||
f"- Date range for contributor list: {start_date} to " f"{end_date}\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The f-string is unnecessarily split across two concatenated strings. This should be a single f-string for better readability: f\"- Date range for contributor list: {start_date} to {end_date}\\n\"
f"- Date range for contributor list: {start_date} to " f"{end_date}\n" | |
f"- Date range for contributor list: {start_date} to {end_date}\n" |
Copilot uses AI. Check for mistakes.
This PR adds support for displaying contributor reports directly in the GitHub Actions Job Summary interface, providing immediate visibility of results without needing to check separate files or issues.
What's Changed
The action now automatically writes the contributor report to the GitHub Actions Job Summary when running in a GitHub Actions environment. This utilizes the
$GITHUB_STEP_SUMMARY
environment variable to display the same markdown content that is written to thecontributors.md
file.Key Features
$GITHUB_STEP_SUMMARY
environment variable is availableExample
When the action runs in a GitHub Actions workflow, users will now see the contributor report displayed directly in the workflow run summary:
Implementation Details
The implementation adds:
generate_markdown_content()
function that creates reusable markdown contentwrite_to_github_summary()
function that writes to the step summary when availablewrite_to_markdown()
function to call both file and summary writingThis enhancement significantly improves the user experience by making contributor information immediately visible in the GitHub Actions interface while maintaining all existing functionality.
Fixes #91.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.