Skip to content

feat: add workflow to auto-label translation PRs#749

Open
wahajmasood wants to merge 1 commit into
pyOpenSci:mainfrom
wahajmasood:feat/label-translation-prs
Open

feat: add workflow to auto-label translation PRs#749
wahajmasood wants to merge 1 commit into
pyOpenSci:mainfrom
wahajmasood:feat/label-translation-prs

Conversation

@wahajmasood

Copy link
Copy Markdown

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 #702

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

feat: create a github action that tags a pr that modifies a po file as "translations

1 participant