Skip to content

Commit

Permalink
Use pull_request in validation workflow (#56)
Browse files Browse the repository at this point in the history
See #55 - using pull_request_target would allow the workflow to run without authorization. While there are some code in this workflow to defend against naive attacks e.g. adding scripts to the actions, there could be other attack vectors e.g. via specially crafted branch names or file names that evade GitHub's escape rules. It would be too hard to wrap our head around this, so the easiest way to defend against it would be to restrict full validation that require access to secrets to PRs opened from branches in this repo.

For PRs opened from forks, I think we should go back to what I proposed in #10 - that is, only run local validations that require no access to secrets, and use `pull_request` for it.

cc @aduh95 @nodejs/tsc
  • Loading branch information
joyeecheung authored Jan 9, 2025
1 parent 7d77fc3 commit f8e9222
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Validate newly added JSON

on:
pull_request_target:
pull_request:
types:
- opened
- ready_for_review
Expand Down

0 comments on commit f8e9222

Please sign in to comment.