Skip to content

Commit c8da445

Browse files
committed
[bfops/wasm-test]: Merge remote-tracking branch 'wasm-fork/rust-web-sdk-updated' into bfops/wasm-test
2 parents b81c26f + cb1dad1 commit c8da445

80 files changed

Lines changed: 2078 additions & 675 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pr_approval_check.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
name: Review Checks
22

3+
# SECURITY: This workflow uses pull_request_target so that it has write access to
4+
# set commit statuses on external (fork) PRs. pull_request_target runs in the
5+
# context of the base branch, which grants the GITHUB_TOKEN write permissions
6+
# that a regular pull_request event on a fork would not have.
7+
#
8+
# IMPORTANT: This workflow must NEVER check out, build, or execute code from the
9+
# PR branch. Doing so would allow a malicious fork to run arbitrary code with
10+
# write access to the repository. This workflow only reads PR metadata via the
11+
# GitHub API, which is safe.
12+
313
on:
4-
pull_request:
14+
pull_request_target:
515
types: [opened, synchronize, reopened]
616
pull_request_review:
717
types: [submitted, dismissed]
@@ -20,8 +30,8 @@ jobs:
2030
publish-approval-status:
2131
name: Set approval status
2232
runs-on: ubuntu-latest
23-
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}
2433

34+
# SECURITY: Do not add a checkout step to this job. See comment at the top of this file.
2535
steps:
2636
- name: Evaluate and publish approval status
2737
uses: actions/github-script@v7
@@ -42,7 +52,10 @@ jobs:
4252
const pr = context.payload.pull_request;
4353
targetSha = pr.head.sha;
4454
45-
if (pr.user.login !== "clockwork-labs-bot") {
55+
if (pr.head.repo.fork) {
56+
state = "success";
57+
description = "Skipped for external PR";
58+
} else if (pr.user.login !== "clockwork-labs-bot") {
4659
state = "success";
4760
description = "PR author is not clockwork-labs-bot";
4861
} else {

0 commit comments

Comments
 (0)