Last active
December 2, 2024 23:16
-
-
Save racecarparts/6d71c38be5c3650fab4b92376630ee53 to your computer and use it in GitHub Desktop.
Script and config to display a list of Github org PRs.
This file contains hidden or 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
echo "Script moved, please visit:" | |
echo "https://github.com/racecarparts/dotfiles/blob/main/.util/follow_github_org_prs.sh" |
This file contains hidden or 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
GITHUB_TOKEN="<gh token>" | |
ORG_NAME="<gh org name>" | |
TEAM_SLUG="<gh team name>" # depending on org this might be relevant to filter repos | |
TEAM_MEMBERS="<gh_username_1>,<gh_username_2>" | |
MAX_TITLE_LENGTH=32 | |
DATE_RANGE_START=$(date -v-6m '+%Y-%m-%dT%H:%M:%SZ') # For macOS (adjust accordingly) | |
INTERVAL_MINUTES=10 # Refresh interval in minutes | |
# Emoji configuration for teams | |
TEAM_EMOJIS=( | |
["backend"]="π" | |
["ios"]="π" | |
["android"]="π₯" | |
) | |
DEFAULT_TEAM_EMOJI="βοΈ" | |
GRAPHQL_QUERY=$(cat <<EOF | |
{ | |
organization(login: "$ORG_NAME") { | |
team(slug: "$TEAM_SLUG") { | |
repositories(first: 100) { | |
edges { | |
node { | |
name | |
pullRequests(states: OPEN, first: 100, orderBy: {field: CREATED_AT, direction: ASC}) { | |
edges { | |
node { | |
title | |
url | |
number | |
createdAt | |
author { | |
login | |
} | |
isDraft | |
reviews(first: 10) { | |
edges { | |
node { | |
author { | |
login | |
} | |
state | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
EOF | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment