Skip to content

Commit

Permalink
Set elevated token permissions (#1111)
Browse files Browse the repository at this point in the history
Set permissions to allow automated comments and write commit status to
the PR.

Manually tested on `pulumiverse/pulumi-scaleway`:

* commenting on the PR
*
[commit](pulumiverse/pulumi-scaleway@9bd9221)
* workflow
[before](https://github.com/pulumiverse/pulumi-scaleway/actions/runs/11554373185)
/
[after](https://github.com/pulumiverse/pulumi-scaleway/actions/runs/11554533807)
* writing back the sentinel commit status
*
[commit](pulumiverse/pulumi-scaleway@f4c7cf6)
* workflow
[before](https://github.com/pulumiverse/pulumi-scaleway/actions/runs/11554533807)
/
[after](https://github.com/pulumiverse/pulumi-scaleway/actions/runs/11554834824)
  • Loading branch information
ringods authored Oct 28, 2024
1 parent e373da7 commit 1dae09c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
prerequisites:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
Expand Down Expand Up @@ -77,6 +79,8 @@ jobs:
name: sentinel
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
statuses: write
needs:
- test
- build_provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
prerequisites:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
Expand Down Expand Up @@ -89,6 +91,8 @@ jobs:
name: sentinel
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
statuses: write
needs:
- test
- build_provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
prerequisites:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
Expand Down Expand Up @@ -86,6 +88,8 @@ jobs:
name: sentinel
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
statuses: write
needs:
- test
- build_provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
prerequisites:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
Expand Down Expand Up @@ -91,6 +93,8 @@ jobs:
name: sentinel
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
statuses: write
needs:
- test
- build_provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
prerequisites:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
Expand Down Expand Up @@ -104,6 +106,8 @@ jobs:
name: sentinel
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
statuses: write
needs:
- test
- build_provider
Expand Down

0 comments on commit 1dae09c

Please sign in to comment.