diff --git a/.github/workflows/owner-notification.yml b/.github/workflows/owner-notification.yml index 13642611..096b8d17 100644 --- a/.github/workflows/owner-notification.yml +++ b/.github/workflows/owner-notification.yml @@ -1,7 +1,7 @@ name: Owner Notification on: - pull_request: + pull_request_target: types: [opened, synchronize] jobs: @@ -11,7 +11,7 @@ jobs: contents: read pull-requests: write issues: write - + steps: - name: Checkout code uses: actions/checkout@v4 @@ -28,14 +28,15 @@ jobs: - name: Find owners and notify uses: actions/github-script@v7 with: + github-token: ${{ secrets.GITHUB_TOKEN }} script: | const fs = require('fs'); const path = require('path'); - + // Get changed files const changedFiles = `${{ steps.changed-files.outputs.all_changed_files }}`.split(' '); console.log('Changed files:', changedFiles); - + // Function to find OWNER file for a given file path function findOwnerFile(filePath) { const parts = filePath.split('/');