Skip to content

Commit a5bd9e5

Browse files
Copilotrajbos
andauthored
Make CLI build workflow always trigger on PRs with path-change detection (#464)
Remove path filters from pull_request trigger so the workflow runs on every PR to main. Add a check-changes job using dorny/paths-filter to detect CLI-relevant file changes. The build-and-validate job is conditional on that output, so it skips cleanly when no relevant files changed — making this workflow suitable as a PR required status check. Agent-Logs-Url: https://github.com/rajbos/github-copilot-token-usage/sessions/3c397486-6198-42c5-949b-52436ad2c2eb Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
1 parent 2cd32b7 commit a5bd9e5

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

.github/workflows/cli-build.yml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,45 @@ on:
1717
- 'src/toolNames.json'
1818
pull_request:
1919
branches: [main]
20-
paths:
21-
- 'cli/**'
22-
- 'src/sessionDiscovery.ts'
23-
- 'src/sessionParser.ts'
24-
- 'src/tokenEstimation.ts'
25-
- 'src/maturityScoring.ts'
26-
- 'src/usageAnalysis.ts'
27-
- 'src/opencode.ts'
28-
- 'src/types.ts'
29-
- 'src/tokenEstimators.json'
30-
- 'src/modelPricing.json'
31-
- 'src/toolNames.json'
3220

3321
permissions:
3422
contents: read
3523

3624
jobs:
25+
check-changes:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
cli-relevant: ${{ github.event_name == 'push' || steps.filter.outputs.cli-relevant == 'true' }}
29+
steps:
30+
- name: Harden Runner
31+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
32+
with:
33+
egress-policy: audit
34+
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
37+
- name: Check for CLI-relevant file changes
38+
if: github.event_name == 'pull_request'
39+
uses: dorny/paths-filter@de90cc6b5708d14e015ca8c3acee5b86b31db2a8 # v3.0.2
40+
id: filter
41+
with:
42+
filters: |
43+
cli-relevant:
44+
- 'cli/**'
45+
- 'src/sessionDiscovery.ts'
46+
- 'src/sessionParser.ts'
47+
- 'src/tokenEstimation.ts'
48+
- 'src/maturityScoring.ts'
49+
- 'src/usageAnalysis.ts'
50+
- 'src/opencode.ts'
51+
- 'src/types.ts'
52+
- 'src/tokenEstimators.json'
53+
- 'src/modelPricing.json'
54+
- 'src/toolNames.json'
55+
3756
build-and-validate:
57+
needs: check-changes
58+
if: needs.check-changes.outputs.cli-relevant == 'true'
3859
runs-on: ubuntu-latest
3960
env:
4061
node-version: 22

0 commit comments

Comments
 (0)