Skip to content

Instantly share code, notes, and snippets.

@racecarparts
Last active December 2, 2024 23:16
Show Gist options
  • Save racecarparts/6d71c38be5c3650fab4b92376630ee53 to your computer and use it in GitHub Desktop.
Save racecarparts/6d71c38be5c3650fab4b92376630ee53 to your computer and use it in GitHub Desktop.
Script and config to display a list of Github org PRs.
echo "Script moved, please visit:"
echo "https://github.com/racecarparts/dotfiles/blob/main/.util/follow_github_org_prs.sh"
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