Skip to content

Commit 6488bfb

Browse files
committed
ci: ensure profiling job only runs on source code changes
This commit ensures that the profiling job only runs on source code changes only. Signed-off-by: vprashar2929 <[email protected]>
1 parent 571a2eb commit 6488bfb

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/profiling.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,26 @@ on:
33
pull_request:
44

55
jobs:
6+
check-changes:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
changes: ${{ steps.filter.outputs.changes }}
10+
steps:
11+
- name: checkout source
12+
uses: actions/checkout@v5
13+
14+
- name: filter changes
15+
uses: dorny/paths-filter@v3
16+
id: filter
17+
with:
18+
filters: |
19+
changes:
20+
- '**/*.go'
21+
- 'go.mod'
22+
- 'go.sum'
623
profiling:
24+
needs: check-changes
25+
if: needs.check-changes.outputs.changes == 'true'
726
runs-on: ubuntu-latest
827
steps:
928
- name: Install Graphviz
@@ -106,8 +125,9 @@ jobs:
106125
retention-days: 5 # Keep artifact for 5 days
107126

108127
generate-comment-message:
128+
needs: profiling
129+
if: needs.profiling.outcome == 'success'
109130
runs-on: ubuntu-latest
110-
needs: [profiling]
111131
steps:
112132
- name: Checkout source
113133
uses: actions/checkout@v4

0 commit comments

Comments
 (0)