Skip to content

Commit

Permalink
Respond to issue only for non-members
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Mar 18, 2022
1 parent d224bb1 commit 1cdb553
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,28 @@ jobs:
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"
- uses: actions/github-script@v6
- name: Check if Issue author is Org member
id: membercheck
uses: actions/github-script@v6
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@v6
if: steps.membercheck.outputs.result == 'false'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down

0 comments on commit 1cdb553

Please sign in to comment.