github-advanced-security[bot] commented on code in PR #39811:
URL: https://github.com/apache/beam/pull/39811#discussion_r3809604248


##########
.github/workflows/beam_Infrastructure_UsersPermissions.yml:
##########
@@ -44,11 +44,24 @@
     runs-on: [self-hosted, ubuntu-24.04, main]
     timeout-minutes: 30
     steps:
-      - name: Checkout code
+      - name: Checkout secure master code
         uses: actions/checkout@v7
         with:
-          ref: ${{ github.event.pull_request.merged == true && github.base_ref 
|| github.event.pull_request.head.sha }}
+          ref: ${{ github.base_ref || github.ref }}
           persist-credentials: false
+      - name : Checkout only users.yml from the Pull Request
+        uses: actions/checkout@v7
+        with:
+          sparse-checkout: 'infra/iam/users.yml'
+          sparse-checkout-cone-mode: false
+          ref: ${{ github.event.pull_request.head.sha }}
+          path : './pr_users'
+          persist-credentials: false
+      - name: Overwrite users.yml with PR changes

Review Comment:
   ## CodeQL / Checkout of untrusted code in a privileged context
   
   Checkout of untrusted code from [github.event.pull_request.head.sha](1) in a 
privileged workflow with later potential execution (event trigger: 
[pull_request_target](2)).
   Checkout of untrusted code from [github.event.pull_request.head.sha](1) in a 
privileged workflow with later potential execution (event trigger: 
[pull_request_target](2)).
   Checkout of untrusted code from [github.event.pull_request.head.sha](1) in a 
privileged workflow with later potential execution (event trigger: 
[pull_request_target](2)).
   Checkout of untrusted code from [github.event.pull_request.head.sha](1) in a 
privileged workflow with later potential execution (event trigger: 
[pull_request_target](2)).
   
   [Show more 
details](https://github.com/apache/beam/security/code-scanning/1913)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to