Skip to content

Commit

Permalink
chore: add labels to external issues (#1947)
Browse files Browse the repository at this point in the history
add labels to external issues
  • Loading branch information
mathnogueira authored Feb 6, 2023
1 parent 6bf4382 commit b18acb0
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/TEAM_MEMBERS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
adnanrahic
danielbdias
jfermi
jorgeepc
kdhamric
mathnogueira
olha23
schoren
xoscar
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
# Send us messages on slack when users from the community either open new issues or PRs
# Send the tracetest team a notification about a new
# issue opened by a user

on:
issues:
types:
- opened

permissions:
id-token: write
contents: read
issues: write
pull-requests: write

jobs:
notify_slack:
name: Notify team
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Load team members
id: load_team_members
run:
echo "team_members=$(cat .github/TEAM_MEMBERS.txt | tr '\n' ',')" >> $GITHUB_OUTPUT

- name: Check if it's team member
id: is_team_member
if: github.event.action == 'opened'
uses: mathnogueira/[email protected]
with:
blocked_users: adnanrahic, danielbdias, jfermi, jorgeepc, kdhamric, mathnogueira, olha23, schoren, xoscar
blocked_users: ${{ steps.load_team_members.outputs.team_members }}

- name: Notify us if not a kubeshop member
- name: Notify team about issue
if: |
steps.is_team_member.outputs.result == 'false'
uses: rtCamp/action-slack-notify@v2
Expand All @@ -32,4 +47,3 @@ jobs:
SLACK_LINK_NAMES: true
SLACK_FOOTER: ${{ github.event.issue.html_url }}
MSG_MINIMAL: true

46 changes: 46 additions & 0 deletions .github/workflows/community-label-user-requests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Label PRs and issues created by users that are not part
# of the tracetest team.

on:
issues:
types:
- opened

permissions:
id-token: write
contents: read
issues: write
pull-requests: write

jobs:
notify_slack:
name: Label user request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Load team members
id: load_team_members
run:
echo "team_members=$(cat .github/TEAM_MEMBERS.txt | tr '\n' ',')" >> $GITHUB_OUTPUT

- name: Check if it's team member
id: is_team_member
if: github.event.action == 'opened'
uses: mathnogueira/[email protected]
with:
blocked_users: ${{ steps.load_team_members.outputs.team_members }}

- name: Label issue
if: |
steps.is_team_member.outputs.result == 'false'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['user-request']
})

0 comments on commit b18acb0

Please sign in to comment.