Skip to content

Commit e7f53f2

Browse files
pmalarmeCopilot
andauthored
Run CodeQL only on the template repository (#10)
Repos created from this template don't have code scanning enabled, so the CodeQL analyze/upload step fails and the branch appears to crash. Guard the analyze job to run only on the canonical template repo, which works across all triggers including schedule. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 3f6e745 commit e7f53f2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ on:
2323
jobs:
2424
analyze:
2525
name: Analyze (${{ matrix.language }})
26+
# Only run on the canonical template repository. Repos created from this
27+
# template ("Use this template") don't have code scanning enabled, so
28+
# CodeQL's upload would fail and crash the branch. Matching the source repo
29+
# by name works across all triggers, including `schedule` where
30+
# github.event.repository isn't populated.
31+
if: github.repository == 'Azure-Samples/foundry-hosted-agents-workshop'
2632
# Runner size impacts CodeQL analysis time. To learn more, please see:
2733
# - https://gh.io/recommended-hardware-resources-for-running-codeql
2834
# - https://gh.io/supported-runners-and-hardware-resources

0 commit comments

Comments
 (0)