8000 Set minimal workflow token permissions by pnacht · Pull Request #2773 · python/python-docs-es · GitHub
[go: up one dir, main page]

Skip to content

Set minimal workflow token permissions #2773

8000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pr-comment: isolate step that needs additional permissions
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
  • Loading branch information
pnacht committed Dec 8, 2023
commit 997401acc4487638c39383b47328683eac24ebfb
20 changes: 14 additions & 6 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ permissions:
contents: read

jobs:
pr-comment:
define-comment:
name: Entradas sin traducción
runs-on: ubuntu-22.04
permissions:
issues: write
pull-requests: write
outputs:
any_changed: ${{ steps.changed-files.outputs.any_changed }}
comment: ${{ steps.create-pr-comment.outputs.comment }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -43,9 +43,17 @@ jobs:
python scripts/list_missing_entries.py --github $CHANGED_PO_FILES
echo EOF
} >> "$GITHUB_OUTPUT"

write-comment:
runs-on: ubuntu-22.04
needs: [define-comment]
if: needs.define-comment.outputs.any_changed == 'true'
permissions:
issues: write
pull-requests: write
steps:
- name: Agregar comentario con entradas faltantes
if: steps.changed-files.outputs.any_changed == 'true'
uses: thollander/actions-comment-pull-request@v2
with:
message: ${{ steps.create-pr-comment.outputs.comment }}
message: ${{ needs.define-comment.outputs.comment }}
comment_tag: missing-entries
0