Skip to content

Commit

Permalink
[ci] Add workflow to label PRs from core team (#7451)
Browse files Browse the repository at this point in the history
Reuses the main repo's workflow to label if a PR is opened by a core team member.
  • Loading branch information
poteto authored Jan 24, 2025
1 parent 7cdbed0 commit 07f13ab
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/label_core_team_prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Label Core Team PRs

on:
pull_request_target:

env:
TZ: /usr/share/zoneinfo/America/Los_Angeles
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

jobs:
check_maintainer:
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
with:
actor: ${{ github.event.pull_request.user.login }}

label:
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
runs-on: ubuntu-latest
needs: check_maintainer
steps:
- name: Label PR as React Core Team
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.number }},
labels: ['React Core Team']
});

0 comments on commit 07f13ab

Please sign in to comment.