Skip to content

Commit 997401a

Browse files
committed
pr-comment: isolate step that needs additional permissions
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
1 parent 575e398 commit 997401a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/pr-comment.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ permissions:
77
contents: read
88

99
jobs:
10-
pr-comment:
10+
define-comment:
1111
name: Entradas sin traducción
1212
runs-on: ubuntu-22.04
13-
permissions:
14-
issues: write
15-
pull-requests: write
13+
outputs:
14+
any_changed: ${{ steps.changed-files.outputs.any_changed }}
15+
comment: ${{ steps.create-pr-comment.outputs.comment }}
1616
steps:
1717
- uses: actions/checkout@v4
1818
with:
@@ -43,9 +43,17 @@ jobs:
4343
python scripts/list_missing_entries.py --github $CHANGED_PO_FILES
4444
echo EOF
4545
} >> "$GITHUB_OUTPUT"
46+
47+
write-comment:
48+
runs-on: ubuntu-22.04
49+
needs: [define-comment]
50+
if: needs.define-comment.outputs.any_changed == 'true'
51+
permissions:
52+
issues: write
53+
pull-requests: write
54+
steps:
4655
- name: Agregar comentario con entradas faltantes
47-
if: steps.changed-files.outputs.any_changed == 'true'
4856
uses: thollander/actions-comment-pull-request@v2
4957
with:
50-
message: ${{ steps.create-pr-comment.outputs.comment }}
58+
message: ${{ needs.define-comment.outputs.comment }}
5159
comment_tag: missing-entries

0 commit comments

Comments
 (0)