generated from ucan-lab/docker-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (45 loc) · 1.69 KB
/
assign-label.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Assign Label
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize, reopened]
jobs:
assign-label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/labeler@v5
if: ${{ contains(fromJson('["opened", "synchronize"]'), github.event.action) }}
with:
configuration-path: .github/labeler.yaml
check-require-label:
needs: assign-label
permissions:
pull-requests: read
runs-on: ubuntu-latest
steps:
- id: labels
shell: bash
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.number }}
run: |
json=$(gh pr view "$PR_NUMBER" --json labels | jq -c '.labels|map(.name)')
echo "json=$json" >> "$GITHUB_OUTPUT"
- name: Echo Label
run: echo "${{ steps.labels.outputs.json }}"
- name: bug, chore, dependencies, documentation, enhancement, refactor, release の中からいずれかのラベルを指定してください。
if: >-
! contains(fromJSON(steps.labels.outputs.json), 'bug') &&
! contains(fromJSON(steps.labels.outputs.json), 'chore') &&
! contains(fromJSON(steps.labels.outputs.json), 'dependencies') &&
! contains(fromJSON(steps.labels.outputs.json), 'documentation') &&
! contains(fromJSON(steps.labels.outputs.json), 'enhancement') &&
! contains(fromJSON(steps.labels.outputs.json), 'refactor') &&
! contains(fromJSON(steps.labels.outputs.json), 'release')
run: exit 1
- name: Successfully
run: exit 0