-
Notifications
You must be signed in to change notification settings - Fork 27
79 lines (76 loc) · 2.37 KB
/
pr-comments.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: 'PR Comments'
on:
pull_request_target:
branches:
- main
paths:
- 'helm/*/Chart.yaml'
- 'VERSION'
jobs:
changes:
runs-on: ubuntu-latest
outputs:
charts: ${{ steps.filter.outputs.charts }}
chartyaml: ${{ steps.filter.outputs.chartyaml }}
go: ${{ steps.filter.outputs.go }}
tag: ${{ steps.filter.outputs.tag }}
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout repo
uses: actions/checkout@v3
- id: filter
uses: dorny/[email protected]
with:
filters: |
chartyaml:
- 'helm/ngrok-operator/Chart.yaml'
charts:
- 'helm/ngrok-operator/**'
- 'scripts/e2e.sh'
go:
- '**.go'
- 'go.mod'
- 'go.sum'
- 'cmd/**'
- 'internal/**'
- 'pkg/**'
- 'Dockerfile'
- 'scripts/e2e.sh'
- 'VERSION'
tag:
- 'VERSION'
# Action that will automatically comment on PRs based on changes
pr-comments:
name: Comment on PR
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [changes]
permissions:
pull-requests: write
steps:
- if: needs.changes.outputs.chartyaml == 'true'
name: Notify about changes to Chart.yaml
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ":wave: Looks like there are changes in the Helm Chart's Chart.yaml file. Upon merge, a new release of the helm chart will be created if the Chart's version was changed."
})
- if: needs.changes.outputs.tag == 'true'
name: Notify about version change
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ":wave: Looks like there are changes in the `VERSION` file. Upon merge, a new release of the docker image will be created. Please make sure the version is updated appropriately."
})