Poll for Git Mastery problem sets #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Poll for Git Mastery problem sets | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 12 * * *" | |
jobs: | |
poll: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch all | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.ORG_PAT }} | |
script: | | |
const repos = await github.paginate(github.rest.search.repos, { | |
q: "topic:problem-set org:git-mastery", | |
}) | |
const repoGroups = new Map(); | |
for (const repo of repos) { | |
for (const topic of repo.topics) { | |
if (topic !== "problem-set") { | |
if (!repoGroups.has(topic)) { | |
repoGroups.set(topic, []) | |
} | |
repoGroups.get(topic).push(repo) | |
} | |
} | |
} | |
console.log(repoGroups) |