| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…l workflow approval
| jobs: | ||
| build_and_test_Windows: | ||
| name: "Windows: Build and Tests" | ||
| if: ${{ github.event_name != 'pull_request_target' || startsWith(github.actor, 'copilot') || github.actor == 'github-copilot[bot]' }} |
Code scanning / SonarCloud
Workflows should not rely on unverified GitHub context values to trust events High
| jobs: | ||
| build_and_test_Windows: | ||
| name: "Windows: Build and Tests" | ||
| if: ${{ github.event_name != 'pull_request_target' || startsWith(github.actor, 'copilot') || github.actor == 'github-copilot[bot]' }} |
Code scanning / SonarCloud
Workflows should not rely on unverified GitHub context values to trust events High
|
|
||
| build_and_test_Linux: | ||
| name: "Linux: Build and Tests" | ||
| if: ${{ github.event_name != 'pull_request_target' || startsWith(github.actor, 'copilot') || github.actor == 'github-copilot[bot]' }} |
Code scanning / SonarCloud
Workflows should not rely on unverified GitHub context values to trust events High
|
|
||
| build_and_test_Linux: | ||
| name: "Linux: Build and Tests" | ||
| if: ${{ github.event_name != 'pull_request_target' || startsWith(github.actor, 'copilot') || github.actor == 'github-copilot[bot]' }} |
Code scanning / SonarCloud
Workflows should not rely on unverified GitHub context values to trust events High
There was a problem hiding this comment.
Updates the GitHub Actions CI workflow to allow Copilot-authored pull requests to run without waiting for manual workflow approval by introducing pull_request_target and gating execution.
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| jobs: | ||
| build_and_test_Windows: | ||
| name: "Windows: Build and Tests" | ||
| if: ${{ github.event_name != 'pull_request_target' || startsWith(github.actor, 'copilot') || github.actor == 'github-copilot[bot]' }} |
There was a problem hiding this comment.
The job gate for pull_request_target is spoofable: startsWith(github.actor, 'copilot') would allow any user with a username like copilot-foo to run this workflow in the privileged pull_request_target context. Restrict this to an explicit allow-list of the exact bot account(s) (or a non-spoofable identifier like a known actor_id) to avoid a security bypass.
Sorry, something went wrong.
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} |
There was a problem hiding this comment.
This actions/checkout now always checks out github.event.pull_request.head.sha for pull_request runs, which changes CI from testing the PR merge commit to testing only the PR head commit. That can miss integration failures that would occur after merging. Consider only overriding ref for pull_request_target runs (and keep the default merge ref for pull_request).
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }} |
Sorry, something went wrong.
|
|
||
| build_and_test_Linux: | ||
| name: "Linux: Build and Tests" | ||
| if: ${{ github.event_name != 'pull_request_target' || startsWith(github.actor, 'copilot') || github.actor == 'github-copilot[bot]' }} |
There was a problem hiding this comment.
The job gate for pull_request_target is spoofable: startsWith(github.actor, 'copilot') would allow any user with a username like copilot-foo to run this workflow in the privileged pull_request_target context. Restrict this to an explicit allow-list of the exact bot account(s) (or a non-spoofable identifier like a known actor_id) to avoid a security bypass.
Sorry, something went wrong.
| pull_request: | ||
| types: [opened, synchronize, reopened, edited] | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened, edited] |
There was a problem hiding this comment.
This workflow triggers on both pull_request and pull_request_target. For Copilot-authored PRs, the jobs will run for both events (because the job if passes for pull_request and for pull_request_target), which can create duplicate CI runs and may still leave a blocked pull_request run “waiting for approval”. If the intent is to run only via pull_request_target for Copilot, add a complementary skip condition for the pull_request event (or split into separate workflows).
Sorry, something went wrong.
| - uses: actions/checkout@v4 | ||
|
|
||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} |
There was a problem hiding this comment.
This actions/checkout now always checks out github.event.pull_request.head.sha for pull_request runs, which changes CI from testing the PR merge commit to testing only the PR head commit. That can miss integration failures that would occur after merging. Consider only overriding ref for pull_request_target runs (and keep the default merge ref for pull_request).
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }} |
Sorry, something went wrong.
|
@copilot apply changes based on the comments in this thread |
Sorry, something went wrong.
… duplicate runs Agent-Logs-Url: https://github.com/zzzprojects/System.Linq.Dynamic.Core/sessions/632e64ac-9f3a-4306-8d7b-7a4d7692f107 Co-authored-by: StefH <249938+StefH@users.noreply.github.com>
Applied all changes from the review thread in commit a975fc9:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
No description provided.