Skip to content

Conversation

@amilcarlucas
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings December 1, 2025 20:45
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 performs routine automated pre-commit hook updates and refactors the AI translation workflow to pass translation content directly to the AI inference action instead of using file-based input with GitHub MCP integration.

Key Changes:

  • Updates three pre-commit hook versions (ruff, markdownlint-cli, gitleaks)
  • Modifies AI translation workflow to prepare and pass translation content as inline YAML parameters
  • Updates prompt template to reference the new translation_content parameter

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.pre-commit-config.yaml Bumps versions for ruff (v0.14.6→v0.14.7), markdownlint-cli (v0.45.0→v0.46.0), and gitleaks (v8.29.1→v8.30.0)
.github/workflows/ai-translation.yml Adds "Prepare translation payload" step to JSON-encode file content and passes it inline via translation_content parameter; removes file_input and enable-github-mcp configuration
.github/prompts/ai-translation-user.prompt.yml Adds {{translation_content}} placeholder to receive translation strings directly in the prompt

- name: Prepare translation payload
id: translation_payload
run: |
python -c "import json, os; from pathlib import Path; content = Path('${{ matrix.file }}').read_text(encoding='utf-8'); fh = open(os.environ['GITHUB_OUTPUT'], 'a', encoding='utf-8'); fh.write('json=' + json.dumps(content) + '\n'); fh.close()"
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The Python one-liner is difficult to read and maintain. Consider breaking it into a separate Python script file for better readability and easier debugging.

For example, create a script like .github/scripts/prepare_translation_payload.py:

#!/usr/bin/env python3
import json
import os
import sys
from pathlib import Path

translation_file = sys.argv[1]
content = Path(translation_file).read_text(encoding='utf-8')

with open(os.environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as fh:
    fh.write('json=' + json.dumps(content) + '\n')

Then call it with:

run: python .github/scripts/prepare_translation_payload.py "${{ matrix.file }}"

Copilot uses AI. Check for mistakes.
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

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