Skip to content

Commit 298d46b

Browse files
authored
Implement repository exclusion in fetch_repositories
Added support for excluding specific repositories from the fetch process.
1 parent 9424768 commit 298d46b

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

β€Žscripts/workspace-intro.shβ€Ž

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ set -euo pipefail
1313
# GitHub
1414
GITHUB_ORG="ARAS-Workspace"
1515

16+
# Excluded repositories
17+
specialExcludedRepos=("wireguard-apple")
18+
1619
# Domain & SSH
1720
DOMAIN="aras.tc"
1821
SSH_USER="workspace"
@@ -54,10 +57,19 @@ C_YELLOW='\033[33m'
5457
# GITHUB API FUNCTIONS
5558
# ═══════════════════════════════════════════════════════════════════════════
5659

60+
61+
5762
fetch_repositories() {
58-
local repos
63+
local repos filtered_repos
64+
local jq_filter
65+
66+
# Build jq filter from excluded repos array
67+
jq_filter=$(printf '"%s",' "${specialExcludedRepos[@]}")
68+
jq_filter="[${jq_filter%,}]"
69+
5970
repos=$(curl -sf "https://api.github.com/orgs/${GITHUB_ORG}/repos?sort=updated&per_page=10" | \
60-
jq -r '[.[] | select(.fork == false)] | .[].name // empty' | head -15)
71+
jq -r --argjson excluded "$jq_filter" \
72+
'[.[] | select(.fork == false) | select(.name as $n | $excluded | index($n) | not)] | .[].name // empty' | head -5)
6173

6274
if [[ -z "$repos" ]]; then
6375
echo "no-repos-found"

0 commit comments

Comments
Β (0)