forked from nginx-openid-connect/nginx-oidc-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 2.11 KB
/
issues.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
name: Issues
on:
issues:
types: [opened]
jobs:
comment:
name: Issue comment
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-22.04
steps:
- name: text
id: controller
if: contains(github.event.issue.body, 'nginx.ingress.kubernetes.io')
run: |
text="\n\n I\'ve parsed the text of your issue and it looks like you might be mixing up the two Ingress Controllers, please take a look at this [page](https://docs.nginx.com/nginx-ingress-controller/intro/nginx-ingress-controllers) to see the differences between \`nginxinc/kubernetes-ingress\` (this repo) and \`kubernetes/ingress-nginx\`."
echo "::set-output name=text::$text"
- name: Check if Issue author is Org member
id: membercheck
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let member
try {
const response = await github.rest.repos.checkCollaborator({
username: context.actor,
owner: context.repo.owner,
repo: context.repo.repo,
})
member = response.data === undefined
console.log({ actor: context.actor, isMember: member })
} catch {
member = false
}
return member
- name: Send message
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
if: steps.membercheck.outputs.result == 'false'
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: 'Hi @${{github.event.issue.user.login}} thanks for reporting! \n\n Be sure to check out the [docs](https://docs.nginx.com/nginx-ingress-controller) while you wait for a human to take a look at this :slightly_smiling_face:${{ steps.controller.outputs.text }}\n\n Cheers!'
})