- Notifications
You must be signed in to change notification settings - Fork396
Commitff774a0
authored
Obtiene SHA correcto para calcular entradas faltantes (#2751)
La versión anterior usaba github.event.pull_request.merge_commit_shapara obtener el commit con el merge entre la rama origen y la ramadestino. Sin embargo, este atributo no siempre está disponible. Enprimer lugar, el atributo puede ser un string o null:https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=opened#pull_requestY segundo, la documentación aclara que el atributo se establece sólo siel atributo "mergeable" es "true", lo cual no ocurre necesariamente deforma inmediate después de abrir un PR. Segúnhttps://docs.github.com/en/free-pro-team@latest/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request:"""The value of the mergeable attribute can be true, false, or null. If thevalue is null, then GitHub has started a background job to compute themergeability. After giving the job time to complete, resubmit therequest. When the job finishes, you will see a non-null value for themergeable attribute in the response. If mergeable is true, thenmerge_commit_sha will be the SHA of the test merge commit. """Este delay en el cálculo de la mergeabilidad de los PRs es probablementelo que está causando que nuestra acción no funcione como deseamos: alejecutarse la primera vez cuando se abre el PR, la acción NO tiene unmerge_commit_sha establecido, por lo que la acción "checkout" procedecon el valor por defecto para el evento pull_request_target, que es larama destino, por lo que todas las entradas aparecen como no traducidas.Este commit cambia el SHA al que hacemos checkout al principio de estaacción para simplemente obtener el HEAD de la rama de origen. Enretrospectiva, obtener el commit de merge no reporta beneficios.Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>1 parentca3cc74 commitff774a0
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
|
0 commit comments
Comments
(0)