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
This commit is contained in:
DevTekVE
2025-10-07 07:45:04 +02:00
committed by GitHub
parent f28cea759d
commit aeaac22274

View File

@@ -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