Crowdin Action fails to detect existing pull request when using a non-main base branch and same-repo source branch
Personne n'a encore pris cette issue.
- #288 par @casper-mercell — fermée sans fusion
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 30/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- github, github-actions, shell
- Domaine
- ci-cd, localization
Piste de recherche
Commencez par la logique de l’action qui construit la requête curl vers PULLS_URL à l’aide des paramètres base et head. Reproduisez le cas d’un branch du même dépôt avec un branch de base différent de main, puis vérifiez qu’un pull request existant est détecté et que sa création est ignorée avec le message de log attendu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
When the base branch for the pull request is not main (e.g., develop), the Crowdin GitHub Action fails to detect an existing pull request from a same-repo source branch (e.g., l10n_crowdin_translations). As a result, it attempts to create a new pull request and fails with a 422 Validation Failed error.
The issue likely occurs because the action uses head=ORG_NAME:BRANCH when calling the GitHub API to check for existing PRs.
To Reproduce
Steps to reproduce the behavior:
- Use the Crowdin GitHub Action with the following relevant configuration:
localization_branch_name: l10n_crowdin_translations
pull_request_base_branch_name: develop
create_pull_request: true
- Ensure that:
- A pull request already exists from l10n_crowdin_translations to develop
- Both branches exist in the same repository (not from a fork)
- Trigger the workflow again (either via schedule or manual dispatch)
Example workflow:
name: Crowdin Action Pull
on:
workflow_dispatch:
schedule:
- cron: '0 7,12 * * *'
jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: crowdin action
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_sources: true
download_translations: true
export_only_approved: true
localization_branch_name: l10n_crowdin_translations
pull_request_base_branch_name: develop
create_pull_request: true
push_sources: true
push_translations: true
pull_request_title: 'New Crowdin Translations'
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_labels: 'Crowdin'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
Expected behavior
The action should detect that a pull request from l10n_crowdin_translations to develop already exists and skip creating a new one. It should log PULL REQUEST ALREADY EXIST instead of failing.
Screenshots
Relevant log from the failing repo:
PUSH TO BRANCH l10n_crowdin_translations
[l10n_crowdin_translations 5b7daab] New Crowdin translations by GitHub Action
1 file changed, 21 insertions(+), 21 deletions(-)
To https://github.com/XXX/YYY.git
+ 27f2ff2...5b7daab l10n_crowdin_translations -> l10n_crowdin_translations (forced update)
CHECK IF PULL REQUEST ALREADY EXIST
CREATE PULL REQUEST
FAILED TO CREATE PULL REQUEST
RESPONSE: {
"message": "Validation Failed",
"errors": [
{
"resource": "PullRequest",
"code": "custom",
"message": "A pull request already exists for XXX:l10n_crowdin_translations."
}
],
"documentation_url": "https://docs.github.com/rest/pulls/pulls#create-a-pull-request",
"status": "422"
}
Additional context
The bug appears in this part of the Crowdin action logic:
pull_requests_response=$(curl ... "${PULLS_URL}?base=${BASE_BRANCH}&head=${ORG_NAME}:${BRANCH}")
When changing into it works
"${PULLS_URL}?base=${BASE_BRANCH}&head=${BRANCH}"
I've verified this by forking the action and applying the fix — and the problem was resolved. The action correctly detects existing pull requests and avoids trying to create duplicates.
- Langage dominant
- Shell
- Étoiles
- 244
- Forks
- 69
- Merge moyen
- 4 j 23 h
- PR mergées (30 j)
- 2
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de crowdin/github-action
-
Convert the action from a Docker container action to a JavaScript (node24) action now that CLI v5 is a native binaryPeut-être pris @minijus l’a pris il y a 12 jours. Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
crowdin/github-action#321 · 3 commentaires · 3 réactions ·
-
bug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
crowdin/github-action#251 · 14 commentaires ·
-
Export settings issueOuverteenhancement
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
crowdin/github-action#247 · 1 commentaire · 2 réactions ·
-
help wanted
Difficulté 3/5 1-2 jours Accessibilité débutants 38/100
crowdin/github-action#220 · 2 commentaires ·
-
macOS Runner SupportOuverteenhancement help wanted
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
crowdin/github-action#160 · 4 commentaires · 1 réaction ·
Toutes les issues de crowdin/github-action
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
txn2/mcp-data-platform#2493 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
omacom/omarchy-mac#792 ·
Les mainteneurs répondent en général sous 4 jours
-
Shell framework build fails at "copy the shader libraries": the iOS shader libraries are now one file b-<chain>.imgPeut-être pris @xiaofeng-han l’a pris aujourd’hui. Ouvertebuild ios
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster P2
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
openclaw/crabbox#3058 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage S3: minor
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
manaflow-ai/cmux#36796 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour