feat: add workflow to auto-label translation PRs - #749
Conversation
Adds .github/workflows/label-translations.yml which listens for pull_request_target events touching locales/**/*.po and applies: - the generic 'translations' label - a per-language 'lang-XX' label extracted from each locales/XX/... path, uppercased to match the existing lang-ES / lang-JA / lang-PT labels Handles multi-language PRs by applying each detected 'lang-XX'. Skips PRs that do not touch any .po file under locales/. Uses pull_request_target so it can add labels on PRs from forks, with least-privilege permissions (pull-requests: write, contents: read) and without checking out or executing PR code. Closes pyOpenSci#702
|
Hi @lwasser friendly nudge on this one whenever you have a spare moment. CI is green and it's mergeable; happy to iterate on anything in review. No rush. Thanks! |
|
I can take a look today @wahajmasood ! |
There was a problem hiding this comment.
🟡 Not ready to approve
The workflow’s permissions don’t grant issues: write needed for issues.addLabels, so labeling will fail at runtime.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds a GitHub Actions workflow to automatically label PRs that modify translation .po files under locales/**, supporting both a general translations label and per-language lang-XX labels derived from the locale path.
Changes:
- Introduces a
pull_request_targetworkflow scoped tolocales/**/*.pochanges. - Detects language codes from changed file paths and applies
translations+lang-XXlabels (multi-language aware).
File summaries
| File | Description |
|---|---|
| .github/workflows/label-translations.yml | New workflow that detects changed locales/**.po files and applies translation-related labels to the PR. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
|
@all-contributors please add @wahajmasood for code |
|
I've put up a pull request to add @wahajmasood! 🎉 |
flpm
left a comment
There was a problem hiding this comment.
LGTM thanks @wahajmasood This will save us some time!!
Adds .github/workflows/label-translations.yml which listens for pull_request_target events touching locales/**/*.po and applies:
Handles multi-language PRs by applying each detected 'lang-XX'. Skips PRs that do not touch any .po file under locales/.
Uses pull_request_target so it can add labels on PRs from forks, with least-privilege permissions (pull-requests: write, contents: read) and without checking out or executing PR code.
Closes #702