Copilot commented on code in PR #8912:
URL: https://github.com/apache/hadoop/pull/8912#discussion_r4445667076


##########
.github/workflows/fork_ci_status.yml:
##########
@@ -0,0 +1,75 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Mirror the contributor's fork workflow run as an informational check on the
+# upstream pull request. Contributors run build_and_test.yml in their own fork
+# (on `push` or `workflow_dispatch`); this bridge finds the run for the PR's
+# head branch and commit and reports it as the "Build" check.
+# See 
https://github.com/apache/infrastructure-actions/tree/fork-ci/v1.0.0/fork-ci
+name: "Fork CI status"
+
+# Security: this privileged (checks: write) workflow is only triggered via
+# `schedule` and `workflow_dispatch`, so it always runs reviewed code from the
+# default branch and PR events cannot trigger it. It deliberately has no

Review Comment:
   Unlike `schedule`, `workflow_dispatch` runs the ref selected by the 
dispatcher, as `.github/workflow-security.md:145-147` also explains. There is 
no default-branch guard here, so this workflow does not always run code from 
the default branch. Please distinguish the two triggers in this security 
comment rather than implying a restriction that is not enforced.



##########
.github/workflow-security.md:
##########
@@ -132,6 +138,18 @@ have a non-privileged workflow that you need to follow 
with a privileged one. Th
 Since they are privileged, though, you must be careful not to run untrusted
 code or depend on untrusted variables.
 
+#### schedule and workflow_dispatch
+
+***privileged***
+
+`schedule` events run the workflow from the latest commit on the default
+branch. `workflow_dispatch` events run it on a branch chosen by the user who
+dispatches it, and only users with write access can do so. A pull request
+cannot trigger either of them, so the workflow code that runs has been
+reviewed. They can still hold secrets and a write token, so treat any data

Review Comment:
   Not being PR-triggerable does not guarantee that the selected code has been 
reviewed: a user with write access can manually dispatch an unreviewed branch. 
Please describe the write-access trust boundary without asserting code review, 
so this guidance does not imply that `workflow_dispatch` enforces a review 
requirement.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to