-
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 1.28 KB
/
setup-labels.yml
File metadata and controls
36 lines (30 loc) · 1.28 KB
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
name: Setup Repository Labels
# このワークフローは、mainまたはmasterブランチへの最初のpushイベントでトリガーされます。
# トリガー設定: pushイベント時にこのワークフローを実行
on:
- push
permissions:
contents: read
issues: write
jobs:
setup-labels:
runs-on: ubuntu-latest
steps:
# ステップ1: リポジトリをチェックアウト
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0 # 全ての履歴をフェッチ
# ステップ2: 親コミットのハッシュを取得
- name: Get parent hash
run: echo "PARENT_COUNT=$(git rev-parse HEAD^@ | wc -l)" >> $GITHUB_ENV
# ステップ3: ラベルの初期設定
# 初回コミット(親コミットがない場合)のみラベルの初期設定
- name: GitHub Labeler
if: env.PARENT_COUNT == 0
uses: crazy-max/ghaction-github-labeler@v5.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
skip-delete: false # trueのとき、定義ファイルに記載の無いラベルの削除を行わない
dry-run: false # trueの場合は、結果のみ表示で反映しない