Skip to content

Commit 8256471

Browse files
authored
Merge pull request #854 from gitlabhq/workflow-exempt-maintainers
Workflows: Disable triage labels for collaborators
2 parents e12325d + 4f1c749 commit 8256471

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.github/workflows/issue-comment-created.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ permissions:
1212
jobs:
1313
remove-labels:
1414
runs-on: ubuntu-latest
15+
# This job contains steps which are expected to fail.
16+
continue-on-error: true
1517
steps:
18+
- name: Is comment from a collaborator?
19+
uses: octokit/[email protected]
20+
with:
21+
route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
# Only remove labels if they are NOT a collaborator.
25+
# Reason being, a collaborator may post a comment and add a waiting-response label.
1626
- uses: actions-ecosystem/action-remove-labels@v1
27+
if: ${{ failure() }}
1728
with:
1829
labels: |
1930
stale

.github/workflows/issue-opened.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,21 @@ permissions:
1212
jobs:
1313
add-labels:
1414
runs-on: ubuntu-latest
15+
# This job contains steps which are expected to fail.
16+
continue-on-error: true
1517
steps:
18+
- name: Is opened by a collaborator?
19+
uses: octokit/[email protected]
20+
with:
21+
route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
# Only add triage labels if they are NOT a collaborator.
25+
# This prevents the needs-triage label from being added.
1626
- uses: actions/checkout@v2
27+
if: ${{ failure() }}
1728
- uses: github/[email protected]
29+
if: ${{ failure() }}
1830
with:
1931
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2032
configuration-path: .github/labeler-issue-triage.yml

0 commit comments

Comments
 (0)