Files
supabase/.github/workflows/auto-label-issues.yml
T
Chris Gwilliams 8c14611348 Fix for labelling issues and handling errors (#27393)
* fix for labelling issues and handling errors

* fix typos
2024-06-24 11:35:03 +01:00

46 lines
1.4 KiB
YAML

name: Auto Label Issues
on:
issues:
types: [opened, reopened]
jobs:
check-external:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Check if organization member
id: is-org-member
uses: JamesSingleton/is-organization-member@1.0.0
with:
organization: ${{ github.repository_owner }}
username: ${{ github.event.issue.user.login }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: label-member
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
run: |
if [ ${{ steps.is-org-member.outputs.result }} != "true" ]; then
echo "User is outside of organization, labeling external"
gh issue edit "$NUMBER" --add-label "external-issue"
else
echo "User is within the organization, labeling internal"
gh issue edit "$NUMBER" --add-label "internal-issue"
fi
triage-new:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Label triage
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: to-triage
run: |
echo "Applying triage label for new issue"
gh issue edit "$NUMBER" --add-label "$LABELS"