mirror of
https://github.com/supabase/supabase.git
synced 2026-10-19 08:09:11 +03:00
add action to label external PRs with contributor
This commit is contained in:
2 files changed
+65
No files matched your search
@@ -0,0 +1,15 @@
|
||||
teams/cli:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'docker/**/*'
|
||||
|
||||
team/docs:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'app/docs/**/*'
|
||||
|
||||
teams/frontend:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'apps/studio/**/*'
|
||||
|
||||
teams/website:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'apps/www/**/*'
|
||||
@@ -0,0 +1,50 @@
|
||||
name: Auto Label PRs
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, 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.pull_request.user.login }}
|
||||
GH_TOKEN: ${{ secrets.GH_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" >> $GH_OUTPUT
|
||||
- if: success()
|
||||
run: |
|
||||
echo "User is a member of Supabase org, not applying labels"
|
||||
- name: Label contributor
|
||||
id: label-contributor
|
||||
if: ${{ steps.is-member.outputs.result == 'false' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
USERNAME: ${{ github.event.pull_request.user.login }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
NUMBER: ${{ github.event.pull_request.number }}
|
||||
LABELS: contributor
|
||||
run: |
|
||||
gh pr edit $NUMBER --add-label $LABELS
|
||||
- uses: actions/checkout@v4
|
||||
if: ${{ steps.is-member.outputs.result == 'false' }}
|
||||
- name: Label PR
|
||||
if: ${{ steps.is-member.outputs.result == 'false' }}
|
||||
uses: actions/labeler@v5
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user