github.heygears.com/openimsdk/tools@v0.0.49/.github/workflows/auto-assign-issue.yml (about)

     1  # Copyright © 2023 OpenIM open source community. All rights reserved.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  name: Assign issue to comment author
    16  on:
    17    issue_comment:
    18      types: [created]
    19  jobs:
    20    assign-issue:
    21      if: |
    22        contains(github.event.comment.body, '/assign') || contains(github.event.comment.body, '/accept') &&
    23        !contains(github.event.comment.user.login, 'openimbot') &&
    24        !contains(github.event.comment.user.login, 'kubbot')
    25      runs-on: ubuntu-latest
    26      permissions:
    27        issues: write
    28      steps:
    29        - name: Checkout code
    30          uses: actions/checkout@v4
    31  
    32        - name: Assign the issue
    33          run: |
    34            export LETASE_MILESTONES=$(curl 'https://api.github.com/repos/$OWNER/$PEPO/milestones' | jq -r 'last(.[]).title')
    35            gh issue edit ${{ github.event.issue.number }} --add-assignee "${{ github.event.comment.user.login }}"
    36            gh issue edit ${{ github.event.issue.number }} --add-label "triage/accepted"
    37            gh issue edit ${{ github.event.issue.number }} --milestone "$LETASE_MILESTONES"
    38            gh issue comment $ISSUE --body "@${{ github.event.comment.user.login }} Glad to see you accepted this issue🤲, this issue has been assigned to you. I set the milestones for this issue to [$LETASE_MILESTONES](https://github.com/$OWNER/$PEPO/milestones), We are looking forward to your PR!"
    39          env:
    40            GH_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
    41            ISSUE: ${{ github.event.issue.html_url }}
    42            OWNER: ${{ github.repository_owner }}
    43            REPO: ${{ github.event.repository.name }}