Fix the example of how to comment on pull request. (#220)

It doesn't work without granting permissions.
https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
This commit is contained in:
Avishai Carmel 2022-10-12 14:49:47 +03:00 committed by GitHub
parent a549f5e36f
commit 98db1427e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,6 +87,8 @@ Outputs can be used in subsequent steps to comment on the pull request:
defaults:
run:
working-directory: ${{ env.tf_actions_working_dir }}
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
@ -153,6 +155,8 @@ Instead of creating a new comment each time, you can also update an existing one
defaults:
run:
working-directory: ${{ env.tf_actions_working_dir }}
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2