[infra] update the scorecards-analysis.yml file

Bug: https://github.com/dart-lang/sdk/issues/50497
Change-Id: Id5ee6649ac515fd2985528b373feaa2cc406178b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270500
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index aedb2d9..2272999 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -18,6 +18,8 @@
       security-events: write
       actions: read
       contents: read
+      # Needed to access OIDC token.
+      id-token: write
 
     steps:
       - name: "Checkout code"