chore: update ci
This commit is contained in:
parent
1d9fee23ee
commit
1ad9417550
40
.github/workflows/labeler.yml
vendored
40
.github/workflows/labeler.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: 'Pull Request Labeler'
|
name: 'Pull Request Labeler'
|
||||||
on:
|
on:
|
||||||
- pull_request_target
|
pull_request:
|
||||||
|
types: [opened, labeled, unlabeled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
@ -15,10 +16,35 @@ jobs:
|
|||||||
uses: actions/labeler@v4
|
uses: actions/labeler@v4
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Auto-assign to core PRs
|
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'core')
|
auto-assign:
|
||||||
uses: kentaro-m/auto-assign-action@v1
|
runs-on: ubuntu-latest
|
||||||
|
needs: triage
|
||||||
|
steps:
|
||||||
|
- name: Check if PR has 'core' label
|
||||||
|
id: check_label
|
||||||
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
assignees: 'taskylizard'
|
script: |
|
||||||
env:
|
const prNumber = context.payload.pull_request.number;
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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:
|
||||||
|
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'],
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user