forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore](workflow) Fix security issues with pull_request_target (apach…
…e#26525) In the workflow Code Checks, we use the event pull_request_target which has write permission to enable the actions to comment on our PRs. We should be careful with the write permission and must forbid from running any user code. The previous PR apache#24761 tried its best to achieve this goal. However, there is a scenario lacking of consideration (See apache#26494). apache#26494 attacks the workflow by git submodule way. This PR fixes this scenario by checkouting the external action explicitly in the workflow.
- Loading branch information
1 parent
73607b7
commit 0a8db44
Showing
7 changed files
with
43 additions
and
25 deletions.
There are no files selected for viewing
Submodule action-sh-checker
deleted from
76ab0b
Submodule clang-format-lint-action
deleted from
6adbe1
Submodule clang-tidy-review
deleted from
2c55ef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,15 +30,12 @@ jobs: | |
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" | ||
if: ${{ github.event_name != 'pull_request_target' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Checkout ${{ github.ref }} ( ${{ github.event.pull_request.head.sha }} ) | ||
if: ${{ github.event_name == 'pull_request_target' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
submodules: recursive | ||
|
||
- name: Check License | ||
uses: apache/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters