Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/o2-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Find issues in O2 code
name: O2 linter

# "on": [pull_request_target, push]
"on": [pull_request_target, push]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I missed this is still using pull_request_target. Please move to pull_request.

Suggested change
"on": [pull_request_target, push]
#"on": [pull_request_target, push]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull_request_target is needed to have write permissions for the result comment.

permissions: {}
env:
BRANCH_MAIN: master
Expand Down Expand Up @@ -47,6 +47,8 @@ jobs:
fi
echo "linter_ran=1" >> "$GITHUB_OUTPUT"
[[ "${{ github.event_name }}" == "pull_request_target" ]] && options="-g"
# Checkout the script from the base branch to prevent execution of arbitrary code in the head branch.
git checkout ${{ env.BRANCH_BASE }} -- Scripts/o2_linter.py
# shellcheck disable=SC2086 # Ignore unquoted options.
python3 Scripts/o2_linter.py $options "${files[@]}"
echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits."
Expand Down
Loading