@@ -3,23 +3,38 @@ name: Agrega comentario a PR
33on :
44 pull_request_target :
55
6+ permissions :
7+ contents : read
8+
69jobs :
7- pr -comment :
10+ define -comment :
811 name : Entradas sin traducción
912 runs-on : ubuntu-22.04
13+ outputs :
14+ any_changed : ${{ steps.changed-files.outputs.any_changed }}
15+ comment : ${{ steps.create-pr-comment.outputs.comment }}
1016 steps :
1117 - uses : actions/checkout@v4
1218 with :
1319 ref : ${{ github.event.pull_request.head.sha }}
1420 persist-credentials : false
1521 - name : Preparar Python v3.11
16- uses : actions/setup-python@v4
22+ uses : actions/setup-python@v5
1723 with :
1824 python-version : " 3.11"
1925 cache : " pip"
26+ # checkout these files from the base branch to guarantee they haven't been
27+ # modified by the PR
28+ - uses : actions/checkout@v4
29+ with :
30+ path : base-branch
31+ sparse-checkout-cone-mode : false
32+ sparse-checkout : |
33+ requirements.txt
34+ scripts/list_missing_entries.py
2035 - name : Instalar dependencias
2136 run : |
22- python -m pip install -r requirements.txt
37+ python -m pip install -r base-branch/ requirements.txt
2338 - name : Obtiene lista de archivos con cambios
2439 id : changed-files
2540 uses : tj-actions/changed-files@v40
@@ -34,12 +49,20 @@ jobs:
3449 run : |
3550 {
3651 echo 'comment<<EOF'
37- python scripts/list_missing_entries.py --github $CHANGED_PO_FILES
52+ python base-branch/ scripts/list_missing_entries.py --github $CHANGED_PO_FILES
3853 echo EOF
3954 } >> "$GITHUB_OUTPUT"
55+
56+ write-comment :
57+ runs-on : ubuntu-22.04
58+ needs : [define-comment]
59+ if : needs.define-comment.outputs.any_changed == 'true'
60+ permissions :
61+ issues : write
62+ pull-requests : write
63+ steps :
4064 - name : Agregar comentario con entradas faltantes
41- if : steps.changed-files.outputs.any_changed == 'true'
4265 uses : thollander/actions-comment-pull-request@v2
4366 with :
44- message : ${{ steps.create-pr -comment.outputs.comment }}
67+ message : ${{ needs.define -comment.outputs.comment }}
4568 comment_tag : missing-entries
0 commit comments