Skip to content

Commit

Permalink
chore: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
taskylizard committed Jun 3, 2024
1 parent 1d9fee2 commit 1ad9417
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: 'Pull Request Labeler'
on:
- pull_request_target
pull_request:
types: [opened, labeled, unlabeled]

jobs:
triage:
Expand All @@ -15,10 +16,35 @@ jobs:
uses: actions/labeler@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Auto-assign to core PRs
if: contains(github.event.pull_request.labels.*.name, 'core')
uses: kentaro-m/auto-assign-action@v1

auto-assign:
runs-on: ubuntu-latest
needs: triage
steps:
- name: Check if PR has 'core' label
id: check_label
uses: actions/github-script@v6
with:
script: |
const prNumber = context.payload.pull_request.number;
const labels = await github.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
});
const hasCoreLabel = labels.data.some(label => label.name === 'core');
return hasCoreLabel;
- name: Auto-assign to PR
if: steps.check_label.outputs.result == 'true'
uses: actions/github-script@v6
with:
assignees: 'taskylizard'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
script: |
const prNumber = context.payload.pull_request.number;
await github.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
assignees: ['taskylizard'],
});

0 comments on commit 1ad9417

Please sign in to comment.