Skip to content

Commit 71fddb6

Browse files
committed
pr-comment: Safe checkout of script files
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
1 parent 997401a commit 71fddb6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/pr-comment.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ jobs:
2323
with:
2424
python-version: "3.11"
2525
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
2635
- name: Instalar dependencias
2736
run: |
28-
python -m pip install -r requirements.txt
37+
python -m pip install -r base-branch/requirements.txt
2938
- name: Obtiene lista de archivos con cambios
3039
id: changed-files
3140
uses: tj-actions/changed-files@v40
@@ -40,7 +49,7 @@ jobs:
4049
run: |
4150
{
4251
echo 'comment<<EOF'
43-
python scripts/list_missing_entries.py --github $CHANGED_PO_FILES
52+
python base-branch/scripts/list_missing_entries.py --github $CHANGED_PO_FILES
4453
echo EOF
4554
} >> "$GITHUB_OUTPUT"
4655

0 commit comments

Comments
 (0)