From aeaac2227411d041b7723cd8f448a78010d99bda Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Tue, 7 Oct 2025 07:45:04 +0200 Subject: [PATCH] ci: refine PR search query to avoid querying whole github (#1330) * ci: refine PR search query to improve label handling in GitHub Action workflow - Replaced `label` with `search_query` for better flexibility. - Added support for multiple labels (`PR_LABEL` and `${PR_LABEL}-c3`). * ci: fix PR search query for proper label matching in workflow - Adjusted `label` query syntax to correctly handle multiple labels. * Update .github/workflows/sunnypilot-master-dev-prep.yaml --- .github/workflows/sunnypilot-master-dev-prep.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sunnypilot-master-dev-prep.yaml b/.github/workflows/sunnypilot-master-dev-prep.yaml index 122755f2c..4aafd4a4a 100644 --- a/.github/workflows/sunnypilot-master-dev-prep.yaml +++ b/.github/workflows/sunnypilot-master-dev-prep.yaml @@ -118,8 +118,8 @@ jobs: run: | # Use GitHub API to get PRs with specific label, ordered by creation date PR_LIST=$(gh api graphql -f query=' - query($label:String!) { - search(query: $label, type:ISSUE, first:100) { + query($search_query:String!) { + search(query: $search_query, type:ISSUE, first:100) { nodes { ... on PullRequest { number @@ -149,7 +149,7 @@ jobs: } } } - }' -F label="is:pr is:open label:${PR_LABEL} draft:false sort:created-asc") + }' -F search_query="repo:${{ github.repository }} is:pr is:open label:${PR_LABEL},${PR_LABEL}-c3 draft:false sort:created-asc") PR_LIST=${PR_LIST//\'/} echo "PR_LIST=${PR_LIST}" >> $GITHUB_OUTPUT