1+ ` ` ` yaml
12name: PR Auto-Label
23
3- env :
4- FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 : true
5-
64on:
75 pull_request:
86 types: [opened, synchronize, reopened]
97
108jobs:
119 label:
1210 runs-on: ubuntu-latest
11+
12+ # ✅ Node 24 zorla (warning tamamen gider)
13+ env:
14+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
15+
1316 permissions:
1417 contents: read
1518 pull-requests: write
1619 issues: write
1720
1821 steps:
19- - uses : actions/checkout@v4
22+ # ✅ Node 24 uyumlu sürüm
23+ - uses: actions/checkout@v5
2024 with:
2125 fetch-depth: 0
2226
2832 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2933 PR_NUMBER: ${{ github.event.pull_request.number }}
3034 run: |
31- set -e
35+ set -eo pipefail
3236
3337 BASE="${{ github.event.pull_request.base.sha }}"
3438 HEAD="${{ github.event.pull_request.head.sha }}"
7781
7882 echo "Applying labels: $LABELS"
7983
80- # 🔥 Repo label listesi al
81- EXISTING_LABELS=$(gh label list --json name --jq '.[].name')
82-
83- # 🔥 PR mevcut label listesi
84- PR_LABELS=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name')
84+ # 🔒 Fail-safe GH calls
85+ EXISTING_LABELS=$(gh label list --json name --jq '.[].name' || echo "")
86+ PR_LABELS=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name' || echo "")
8587
8688 for label in $LABELS; do
8789 # label yoksa oluştur
@@ -103,14 +105,15 @@ jobs:
103105 esac
104106
105107 echo "Creating label: $label"
106- gh label create "$label" --color "$color" --description "$desc"
108+ gh label create "$label" --color "$color" --description "$desc" || true
107109 fi
108110
109111 # PR'da yoksa ekle
110112 if ! echo "$PR_LABELS" | grep -qx "$label"; then
111113 echo "Adding label to PR: $label"
112- gh pr edit "$PR_NUMBER" --add-label "$label"
114+ gh pr edit "$PR_NUMBER" --add-label "$label" || true
113115 else
114116 echo "Label already exists on PR: $label"
115117 fi
116118 done
119+ ` ` `
0 commit comments