We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80d67b2 commit cdbf826Copy full SHA for cdbf826
1 file changed
.github/workflows/fragments-check.yml
@@ -20,9 +20,21 @@ jobs:
20
21
- name: Check if linked to the correct pull request
22
run: |
23
- git remote -v
24
- git branch -r
25
diff=$(git diff origin/${{ github.base_ref }} HEAD --name-only)
26
- changelog_fragments=$(echo "$diff" | grep "^.changes/unreleased/")
27
- echo $changelog_fragments
+ changelog_fragments=$(echo "$diff" | grep "^.changes/unreleased/.*\.yaml$")
+ pr_number=${{ github.event.pull_request.number }}
+ found_match=false
+
28
+ for file in $changelog_fragments; do
29
+ if grep -qE "PR: *\"?$pr_number\"?" "$file"; then
30
+ echo "✅ Found PR number $pr_number in $file"
31
+ found_match=true
32
+ fi
33
+ done
34
35
+ if [ "$found_match" = false ]; then
36
+ echo "❌ No matching PR number found in changelog fragments."
37
+ exit 1
38
39
40
0 commit comments