Skip to content

Commit

Permalink
[Bugfix:Developer] Fix draft arranger for old PRs (Submitty#10798)
Browse files Browse the repository at this point in the history
### What is the current behavior?
The auto draft mover fails.

### What is the new behavior?
Fixes one more bug introduced in Submitty#10775. By default, the github CLI only
returns the most recent 30 PRs in queries, so this action would fail for
any PR older than that due to not being able to find the PR ID. This PR
changes the query to search the most recent 9999 PRs instead, which
should be sufficient.
  • Loading branch information
powe97 authored Aug 1, 2024
1 parent 5d89bf7 commit 230a2f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sort_draft_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
PR_PROJECT_ID="$(gh project item-list --owner Submitty 1 --format json --jq "[.items[] | {id, labels, status, title: .content.title, repo: .content.repository, number: .content.number}] | .[] | select(.number == "$PR_ID").id")"
echo "pr-project-id="$PR_PROJECT_ID"" >> "$GITHUB_OUTPUT"
PR_PROJECT_ID="$(gh project item-list -L 9999 --owner Submitty 1 --format json --jq "[.items[] | {id, labels, status, title: .content.title, repo: .content.repository, number: .content.number}] | .[] | select(.number == "$PR_ID").id")"
echo "pr-project-id="${PR_PROJECT_ID:?}"" >> "$GITHUB_OUTPUT"
- name: Move draft to Work in Progress
if: ${{ (github.event.action == 'converted_to_draft') || ((github.event.action == 'opened') && (github.event.pull_request.draft == true)) }}
Expand Down

0 comments on commit 230a2f1

Please sign in to comment.