Files
supabase/.github/workflows/auto-label-issues.yml
T
Chris Gwilliams e2271707cc Feat: Add stale Action for marking stale issues and Action to auto label new issues with source (#27033)
* add stale bot for marking stalue issues and action to auto label an
issues source

* Update auto-label-issues.yml
2024-06-17 06:53:51 +00:00

66 lines
2.0 KiB
YAML

name: Auto Label Issues
on:
issues:
types: [opened, reopened]
jobs:
check-external:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.is-member.outputs.result }}
steps:
- name: Get deps
run: |
sudo apt-get update && sudo apt-get install -y jq
- name: Get org members
id: is-member
env:
GH_ORG: supabase
GH_USER: ${{ github.event.issue.user.login }}
GH_TOKEN: ${{ secrets.SB_ORG_MEMBERSHIP_PAT }}
run: |
gh api /orgs/supabase/members/$GH_USER
- if: failure()
name: is-member
run: |
echo "User is not a member of Supabase org"
echo "result=false" >> "$GITHUB_OUTPUT"
- if: success()
run: |
echo "User is a member of Supabase org"
echo "result=true" >> "$GITHUB_OUTPUT"
- name: Label contributor
id: label-contributor
if: ${{ steps.is-member.outputs.result == 'false' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.event.issue.user.login }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: external-issue
run: |
echo "applying external label"
gh issue edit $NUMBER --add-label $LABELS
- name: Label internal
id: label-internal
if: ${{ steps.is-member.outputs.result == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.event.issue.user.login }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: internal-issue
run: |
echo "applying internal label"
gh issue edit $NUMBER --add-label $LABELS
triage-new:
runs-on: ubuntu-latest
steps:
- name: Label triage
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUMBER: ${{ github.event.issue.number }}
LABELS: to-triage
run: |
echo "applying triage label"
gh issue edit $NUMBER --add-label $LABELS