diff --git a/.github/workflows/preview-comment.yml b/.github/workflows/preview-comment.yml index 36303c3..3a788b0 100644 --- a/.github/workflows/preview-comment.yml +++ b/.github/workflows/preview-comment.yml @@ -2,7 +2,7 @@ name: Pull Request Comments on: - pull_request: + pull_request_target: # Disable permissions for all available scopes by default. # Any needed permissions should be configured at the job level. diff --git a/validate_pr.py b/validate_pr.py index ca298b7..510de88 100644 --- a/validate_pr.py +++ b/validate_pr.py @@ -85,8 +85,9 @@ def find_urls(obj): def get_touched_directories(): - # Run git diff command to get the list of directories touched in the current branch - diff_output = os.popen('git diff --name-only origin/trunk').read() + # Run git diff command to get the list of directories touched in the current branch as compared to + # the point where it was forked from the trunk branch + diff_output = os.popen('git diff --name-only $(git merge-base trunk HEAD)').read() touched_dirs = set() # Extract the directory paths from the diff output