Skip to content

Commit a975fc9

Browse files
CopilotStefH
andcommitted
Fix CI workflow: use exact actor allowlist, fix ref override, prevent 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>
1 parent bf5e724 commit a975fc9

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ permissions:
1414
jobs:
1515
build_and_test_Windows:
1616
name: "Windows: Build and Tests"
17-
if: ${{ github.event_name != 'pull_request_target' || startsWith(github.actor, 'copilot') || github.actor == 'github-copilot[bot]' }}
17+
if: >-
18+
${{
19+
(github.event_name != 'pull_request' && github.event_name != 'pull_request_target') ||
20+
(github.event_name == 'pull_request' && github.actor != 'copilot-swe-agent[bot]' && github.actor != 'github-copilot[bot]') ||
21+
(github.event_name == 'pull_request_target' && (github.actor == 'copilot-swe-agent[bot]' || github.actor == 'github-copilot[bot]'))
22+
}}
1823
runs-on: windows-latest
1924

2025
env:
@@ -25,7 +30,7 @@ jobs:
2530
- uses: actions/checkout@v4
2631
with:
2732
fetch-depth: 0
28-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
33+
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
2934
persist-credentials: false
3035

3136
- uses: actions/setup-dotnet@v4
@@ -42,7 +47,12 @@ jobs:
4247
4348
build_and_test_Linux:
4449
name: "Linux: Build and Tests"
45-
if: ${{ github.event_name != 'pull_request_target' || startsWith(github.actor, 'copilot') || github.actor == 'github-copilot[bot]' }}
50+
if: >-
51+
${{
52+
(github.event_name != 'pull_request' && github.event_name != 'pull_request_target') ||
53+
(github.event_name == 'pull_request' && github.actor != 'copilot-swe-agent[bot]' && github.actor != 'github-copilot[bot]') ||
54+
(github.event_name == 'pull_request_target' && (github.actor == 'copilot-swe-agent[bot]' || github.actor == 'github-copilot[bot]'))
55+
}}
4656
runs-on: ubuntu-latest
4757

4858
env:
@@ -52,7 +62,7 @@ jobs:
5262
steps:
5363
- uses: actions/checkout@v4
5464
with:
55-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
65+
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
5666
persist-credentials: false
5767

5868
- uses: actions/setup-dotnet@v4

0 commit comments

Comments
 (0)