Skip to content

Commit 39fc1ea

Browse files
committed
Añade comentarios a PRs con entradas faltantes
1 parent 893a598 commit 39fc1ea

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/pr-comment.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Agrega comentario a PR
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
pr-comment:
8+
name: Entradas sin traducción
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
ref: ${{ github.event.pull_request.head.sha }}
14+
persist-credentials: false
15+
- name: Preparar Python v3.11
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.11"
19+
cache: "pip"
20+
- name: Instalar dependencias
21+
run: |
22+
python -m pip install -r requirements.txt
23+
- name: Obtiene lista de archivos con cambios
24+
id: changed-files
25+
uses: tj-actions/changed-files@v39
26+
with:
27+
files: |
28+
**/*.po
29+
- name: Calcular entradas faltantes
30+
if: steps.changed-files.outputs.any_changed == 'true'
31+
id: create-pr-comment
32+
env:
33+
CHANGED_PO_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
34+
run: |
35+
{
36+
echo 'comment<<EOF'
37+
python scripts/list_missing_entries.py --github $CHANGED_PO_FILES
38+
echo EOF
39+
} >> "$GITHUB_OUTPUT"
40+
- name: Agregar comentario con entradas faltantes
41+
if: steps.changed-files.outputs.any_changed == 'true'
42+
uses: thollander/actions-comment-pull-request@v2
43+
with:
44+
message: ${{ steps.create-pr-comment.outputs.comment }}
45+
comment_tag: missing-entries

0 commit comments

Comments
 (0)