Skip to content

Commit

Permalink
Add issues trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed Apr 24, 2024
1 parent f8dfb4e commit fd052f7
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,33 @@ name: 'Check labels'
on:
issue_comment:
types: [created]
issues:
types: [opened]
env:
user_type: ${{ contains(fromJSON('["COLLABORATOR","MEMBER","OWNER"]'), github.event.comment.author_association) && 'maintainer' || 'user' }}
is_issue: ${{ !github.event.issue.pull_request }}

permissions:
issues: write

jobs:
check-labels:
if: ${{ !github.event.issue.pull_request }}
if: ${{ env.is_issue }}
runs-on: ubuntu-latest

steps:
- name: Remove `waiting-for-user` label
if: ${{ !contains(fromJSON('["COLLABORATOR","MEMBER","OWNER"]'), github.event.comment.author_association) }}
- name: Add `waiting-for-maintainer` label
if: ${{ github.event_type == 'issues' || env.user_type == 'user' }
env:
ISSUE: ${{ github.event.issue.html_url }}
GH_TOKEN: ${{ github.token }}
run: |
gh issue edit $ISSUE --add-label 'waiting-for-maintainer' --remove-label 'waiting-for-user'
gh issue edit $ISSUE --add-label 'waiting-for-maintainer'
- name: Remove `waiting-for-user` label
if: ${{ env.user_type == 'user' }}
env:
ISSUE: ${{ github.event.issue.html_url }}
GH_TOKEN: ${{ github.token }}
run: |
gh issue edit $ISSUE --remove-label 'waiting-for-user'

0 comments on commit fd052f7

Please sign in to comment.