-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.13 KB
/
add_all_pr_to_project_cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# This workflow finds all PRs in all repos and adds them to the
# project if they have the right label
name: Scheduled PR automation
on:
# schedule:
# # * is a special character in YAML so you have to quote this string
# - cron: '30 5,17 * * *'
workflow_dispatch:
jobs:
get_repos:
name: Get all repositories
runs-on: ubuntu-latest
outputs:
repos: ${{ steps.get_repo.outputs.repositories }}
steps:
- name: Get current repositories
id: get_repo
env:
GH_TOKEN: ${{ secrets.LAB_PAT }}
MAX_REPO: 50
run: |
repo_list=$(gh repo list $GITHUB_REPOSITORY_OWNER --no-archived -L ${MAX_REPO} --json owner,name --jq '.[] | "\(.owner.login)/\(.name)"' | jq -cnR '[inputs | select(length>0)]')
echo "repositories=${repo_list}" >> $GITHUB_OUTPUT
spawn_repo_jobs:
uses: neurobagel/planning/.github/workflows/rw_process_repo_pr.yml@main
name: ${{ matrix.repo }} scheduled PR processing
needs: get_repos
secrets: inherit
strategy:
matrix:
repo: ${{fromJSON(needs.get_repos.outputs.repos)}}
with:
repo: ${{ matrix.repo }}