Skip to content

Commit 1d78942

Browse files
committed
On branch edburns/dd-2855288-add-smoke-test-to-build-and-test Reduce blast radius by tightening permissions.
modified: .github/workflows/build-test.yml @Copilot wrote: > The workflow-level token permissions are set to contents: write, checks: write, and now pull-requests: write for every run, including pull_request events. To reduce blast radius, consider setting the workflow default to read-only and granting write permissions only at the job/step that needs them (the badge PR step needs contents: write + pull-requests: write). This keeps PR runs from having unnecessary write scopes. This is a good suggestion. Signed-off-by: Ed Burns <edburns@microsoft.com>
1 parent eaac544 commit 1d78942

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/build-test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ on:
1919
merge_group:
2020

2121
permissions:
22-
contents: write
23-
checks: write
24-
pull-requests: write
22+
contents: read
2523

2624
jobs:
2725

@@ -35,6 +33,10 @@ jobs:
3533
name: "Java SDK Tests"
3634
needs: smoke-test
3735
if: ${{ always() && needs.smoke-test.result != 'failure' }}
36+
permissions:
37+
contents: write
38+
checks: write
39+
pull-requests: write
3840

3941
runs-on: ubuntu-latest
4042
defaults:

0 commit comments

Comments
 (0)