Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Nov 10, 2022
1 parent 03fb789 commit 7dbc0ae
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/commit-queue.yml
Expand Up @@ -12,6 +12,8 @@ on:
# secrets, which it needs to access Jenkins API.
schedule:
- cron: '*/5 * * * *'
workflow_dispatch:


concurrency: ${{ github.workflow }}

Expand All @@ -25,28 +27,40 @@ jobs:
get_mergeable_prs:
permissions:
pull-requests: read
if: github.repository == 'nodejs/node'
# if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
outputs:
numbers: ${{ steps.get_mergeable_prs.outputs.numbers }}
steps:
- name: Get Pull Requests
id: get_mergeable_prs
run: >
gh pr list \
run: |
prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--json 'number' \
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z")" \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
fast_track_prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--label 'fast-track' \
--json 'number' \
-t '::set-output name=numbers::{{ range . }}{{ .number }} {{ end }}' \
--limit 100
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
echo "numbers=$numbers" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
commitQueue:
needs: get_mergeable_prs
if: needs.get_mergeable_prs.outputs.numbers != ''
runs-on: ubuntu-latest
steps:
- run: echo ${{ needs.get_mergeable_prs.outputs.numbers }} && exit 1
- uses: actions/checkout@v3
with:
# Needs the whole git history for ncu to work
Expand Down

0 comments on commit 7dbc0ae

Please sign in to comment.