Skip to content

Not for review

Not for review #2472

name: issue-label-automation
on:
pull_request_target:
types: [opened]
issues:
types: [opened]
jobs:
automate-labels:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
env:
IS_BOT: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'mergify[bot]') }}
IS_HUMAN: ${{ !(github.actor == 'dependabot[bot]' || github.actor == 'mergify[bot]') }}
steps:
- name: Check if issue or PR was created by external contributor
if: env.IS_HUMAN == 'true' && github.repository_owner == 'celestiaorg'
uses: tspascoal/get-user-teams-membership@v3
id: teamCheck
with:
username: ${{ github.actor }}
team: "celestia-core"
GITHUB_TOKEN: ${{ secrets.PAT_TEAM_CHECK }}
# If an issue was unlabeled add `needs:triage`.
- name: Maybe label issue with `needs:triage`
if: ${{ github.event_name == 'issues' }}
uses: andymckay/labeler@master
with:
add-labels: "needs:triage"
ignore-if-labeled: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
# If an issue or PR was created by someone that isn't part of
# celestia-core, add the `external` label.
- name: Maybe label issue or PR with `external`
if: env.IS_HUMAN == 'true' && steps.teamCheck.outputs.isTeamMember == 'false'
uses: andymckay/labeler@master
with:
add-labels: "external"
repo-token: ${{ secrets.GITHUB_TOKEN }}
# If a PR was created by dependabot or mergify add the `bot` label.
- name: Maybe label PR with `bot`
if: env.IS_BOT == 'true'
uses: andymckay/labeler@master
with:
add-labels: "bot"
repo-token: ${{ secrets.GITHUB_TOKEN }}