-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_board.sh
More file actions
86 lines (80 loc) · 4.23 KB
/
sync_board.sh
File metadata and controls
86 lines (80 loc) · 4.23 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# Autonet Project Boards Sync
# Run this at session start to get current state across all workstreams
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ AUTONET PROJECT STATUS ║"
echo "╚══════════════════════════════════════════════════════════════╝"
echo ""
# Function to fetch board status
fetch_board() {
local project_num=$1
local project_name=$2
echo "┌─────────────────────────────────────────────────────────────┐"
echo "│ $project_name"
echo "└─────────────────────────────────────────────────────────────┘"
gh api graphql -f query="
{
organization(login: \"autonet-code\") {
projectV2(number: $project_num) {
items(first: 100) {
totalCount
nodes {
fieldValues(first: 10) {
nodes {
... on ProjectV2ItemFieldSingleSelectValue {
name
field { ... on ProjectV2SingleSelectField { name } }
}
}
}
content {
... on Issue {
number
title
state
}
}
}
}
}
}
}" --jq "
.data.organization.projectV2 as \$proj |
\"Total items: \(\$proj.items.totalCount)\",
\"\",
\"BY STATUS:\",
(\$proj.items.nodes | map(
(.fieldValues.nodes[] | select(.field.name == \"Status\") | .name) // \"No Status\"
) | group_by(.) | map(\" \(.[0]): \(length)\") | .[]),
\"\",
\"IN PROGRESS:\",
(\$proj.items.nodes | map(
select((.fieldValues.nodes[] | select(.field.name == \"Status\") | .name) == \"In progress\") |
\" #\(.content.number): \(.content.title)\"
) | if length == 0 then [\" (none)\"] else . end | .[:5] | .[])
" 2>/dev/null
echo ""
}
# Fetch all four boards
fetch_board 4 "MOVIE PRODUCTION (Project #4)"
fetch_board 6 "SYSTEMS DESIGN (Project #6)"
fetch_board 7 "MANIFESTING (Project #7)"
fetch_board 8 "AUTONOMOUS CHARTER (Project #8)"
echo "┌─────────────────────────────────────────────────────────────┐"
echo "│ QUICK LINKS │"
echo "└─────────────────────────────────────────────────────────────┘"
echo " Movie: https://github.com/orgs/autonet-code/projects/4"
echo " Systems: https://github.com/orgs/autonet-code/projects/6"
echo " Manifest: https://github.com/orgs/autonet-code/projects/7"
echo " Charter: https://github.com/orgs/autonet-code/projects/8"
echo " Repo: https://github.com/autonet-code/2029"
echo ""
echo "┌─────────────────────────────────────────────────────────────┐"
echo "│ REPO STRUCTURE │"
echo "└─────────────────────────────────────────────────────────────┘"
echo " /movie/screenplay/ - Treatment, screenplay"
echo " /movie/production/ - Breakdown, style notes"
echo " /systems/ - Food, justice, manufacturing specs"
echo " /story/ - Novella, worldbuilding"
echo " /manifesting/ - Action items (forward + backward)"
echo " /manifesting/from_now/autonomous-charter/ - Yacht charter venture"