diff --git a/.github/workflows/issue-comment-created.yml b/.github/workflows/issue-comment-created.yml index 9d3337151..982f15d03 100644 --- a/.github/workflows/issue-comment-created.yml +++ b/.github/workflows/issue-comment-created.yml @@ -12,8 +12,19 @@ permissions: jobs: remove-labels: runs-on: ubuntu-latest + # This job contains steps which are expected to fail. + continue-on-error: true steps: + - name: Is comment from a collaborator? + uses: octokit/request-action@v2.x + with: + route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Only remove labels if they are NOT a collaborator. + # Reason being, a collaborator may post a comment and add a waiting-response label. - uses: actions-ecosystem/action-remove-labels@v1 + if: ${{ failure() }} with: labels: | stale diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml index e15d6dc7a..278983713 100644 --- a/.github/workflows/issue-opened.yml +++ b/.github/workflows/issue-opened.yml @@ -12,9 +12,21 @@ permissions: jobs: add-labels: runs-on: ubuntu-latest + # This job contains steps which are expected to fail. + continue-on-error: true steps: + - name: Is opened by a collaborator? + uses: octokit/request-action@v2.x + with: + route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Only add triage labels if they are NOT a collaborator. + # This prevents the needs-triage label from being added. - uses: actions/checkout@v2 + if: ${{ failure() }} - uses: github/issue-labeler@v2.4 + if: ${{ failure() }} with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler-issue-triage.yml