chore(deps): update dependency wrangler to v4.73.0 #328
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check PR Labels | |
| on: | |
| pull_request: | |
| types: [opened, labeled, unlabeled, synchronize] | |
| jobs: | |
| check-labels: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check for required labels | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # リポジトリの全ラベルを取得 | |
| VALID_LABELS=$(gh label list --repo ${{ github.repository }} --json name --jq '[.[].name] | join(",")') | |
| # PRのラベルを取得 | |
| PR_LABELS=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json labels --jq '[.labels[].name] | join(",")') | |
| echo "リポジトリの有効なラベル: $VALID_LABELS" | |
| echo "PRに付いているラベル: $PR_LABELS" | |
| # PRにラベルが付いているかチェック | |
| if [ -z "$PR_LABELS" ]; then | |
| echo "::error::PRにはラベルを付けてください" | |
| echo "利用可能なラベル: $VALID_LABELS" | |
| exit 1 | |
| fi | |
| # PRのラベルが有効なラベルに含まれているかチェック | |
| IFS=',' read -ra PR_LABEL_ARRAY <<< "$PR_LABELS" | |
| IFS=',' read -ra VALID_LABEL_ARRAY <<< "$VALID_LABELS" | |
| FOUND=false | |
| VALID_PR_LABELS="" | |
| for pr_label in "${PR_LABEL_ARRAY[@]}"; do | |
| for valid_label in "${VALID_LABEL_ARRAY[@]}"; do | |
| if [ "$pr_label" = "$valid_label" ]; then | |
| FOUND=true | |
| if [ -z "$VALID_PR_LABELS" ]; then | |
| VALID_PR_LABELS="$pr_label" | |
| else | |
| VALID_PR_LABELS="$VALID_PR_LABELS, $pr_label" | |
| fi | |
| break | |
| fi | |
| done | |
| done | |
| if [ "$FOUND" = true ]; then | |
| echo "✅ 有効なラベルが付いています: $VALID_PR_LABELS" | |
| else | |
| echo "::error::PRには有効なラベルを付けてください" | |
| echo "現在のラベル: $PR_LABELS" | |
| echo "利用可能なラベル: $VALID_LABELS" | |
| exit 1 | |
| fi |