Skip to content

Commit bb2e462

Browse files
committed
ci: enable comment on PR in case of config change
This commit adds a new workflow that will check if the Kepler config/ directory has been changed in a PR. If it has, it will comment on the PR to notify the author to make sure that the relevant changes are also made to desired places like: - docs/configuration/configuration.md - compose/dev/kepler-dev/etc/kepler/config.yaml - hack/config.yaml - manifests/k8s/configmap.yaml Signed-off-by: vprashar2929 <[email protected]>
1 parent a62cf34 commit bb2e462

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/config-change.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check Config Changes
2+
3+
on: #yamllint disable-line rule:truthy
4+
pull_request_target:
5+
branches: [reboot]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: write
10+
11+
jobs:
12+
check-changes:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
changes: ${{ steps.filter.outputs.changes }}
16+
steps:
17+
- name: Checkout source
18+
uses: actions/checkout@v4
19+
20+
- name: Filter changes
21+
uses: dorny/paths-filter@v3
22+
id: filter
23+
with:
24+
filters: |
25+
changes:
26+
- 'config/**/*.go'
27+
28+
comment-on-pr:
29+
needs: check-changes
30+
if: needs.check-changes.outputs.changes == 'true'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Comment on PR
34+
uses: thollander/actions-comment-pull-request@v3
35+
with:
36+
message: |
37+
:warning: Config changes detected in this PR.
38+
Please make sure that the config changes are updated in the following places as part of this PR:
39+
- docs/configuration/configuration.md
40+
- compose/dev/kepler-dev/etc/kepler/config.yaml
41+
- hack/config.yaml
42+
- manifests/k8s/configmap.yaml

0 commit comments

Comments
 (0)