diff --git a/.github/workflows/pr_assign_milestone.yml b/.github/workflows/pr_assign_milestone.yml index ded69c07c86..8b637f5fe36 100644 --- a/.github/workflows/pr_assign_milestone.yml +++ b/.github/workflows/pr_assign_milestone.yml @@ -38,9 +38,14 @@ jobs: sort: 'due_on', direction: 'asc' }) - const milestone = list.data - console.log(milestone) - return milestone.length == 0 ? null : milestone[0].number + for( const milestone of list.data) { + if ( milestone.due_on !== null ) { + console.log(milestone) + return milestone.number + break; + } + } + return null - name: add milestone uses: actions/github-script@v7 with: diff --git a/.github/workflows/self_assign.yml b/.github/workflows/self_assign.yml index e6c4f212827..561299d8817 100644 --- a/.github/workflows/self_assign.yml +++ b/.github/workflows/self_assign.yml @@ -38,8 +38,14 @@ jobs: sort: 'due_on', direction: 'asc' }) - const milestone = list.data - return milestone.length == 0 ? null : milestone[0].number + for( const milestone of list.data) { + if ( milestone.due_on !== null ) { + console.log(milestone) + return milestone.number + break; + } + } + return null - uses: actions/github-script@v7 with: script: |