-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(workflows): fix jq error in propagate-hooks.yml #778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,44 +72,38 @@ | |
| # Get the SHA of the current commit (triggering commit) | ||
| TRIGGER_SHA="${{ github.sha }}" | ||
|
|
||
| # In a real implementation, we would: | ||
| # 1. Query the GitHub API for all repos in hyperpolymath and metadatastician orgs | ||
| # 2. Filter for repos that have a .githooks directory | ||
| # 3. Check if their .githooks is behind the standards repo | ||
| # | ||
| # For this workflow, we'll use a representative list | ||
| # In production, this would be dynamically generated | ||
|
|
||
| # Hyperpolymath estate repos (sample - would be all ~8,000+ repos) | ||
| HYPERPOLYMATH_REPOS=( | ||
| "hyperpolymath/standards" | ||
| "hyperpolymath/harvard-dehallucinator" | ||
| "hyperpolymath/echidnabot" | ||
| "hyperpolymath/universal-chat-extractor" | ||
| "hyperpolymath/developer-ecosystem" | ||
| "hyperpolymath/scaffoldia" | ||
| "hyperpolymath/a2ml-ecosystem" | ||
| "hyperpolymath/reposystem" | ||
| ) | ||
|
|
||
| # Metadatastician estate repos (sample - would be all ~500+ repos) | ||
| METADATASTICIAN_REPOS=( | ||
| "metadatastician/svalinn" | ||
| "metadatastician/stapeln" | ||
| "metadatastician/gossamer" | ||
| "metadatastician/cerro-torre" | ||
| "metadatastician/vordr" | ||
| "metadatastician/cadastra" | ||
| ) | ||
|
|
||
| # Check if specific repo was requested | ||
| if [ -n "${{ github.event.inputs.target-repo }}" ]; then | ||
| TARGET="${{ github.event.inputs.target-repo }}" | ||
| REPOS_JSON=$(jq -n --arg repo "$TARGET" '[$repo]') | ||
| else | ||
| # Combine all repos | ||
| ALL_REPOS=("${HYPERPOLYMATH_REPOS[@]}" "${METADATASTICIAN_REPOS[@]}") | ||
| REPOS_JSON=$(jq -n --args '$ARGV' "${ALL_REPOS[@]}") | ||
| # Use a sample list for now - TODO: Query all repos dynamically | ||
|
Check warning on line 80 in .github/workflows/propagate-hooks.yml
|
||
| # For production, this should query the GitHub API for all repos | ||
| # in hyperpolymath and metadatastician orgs and filter by .githooks | ||
| ALL_REPOS=( | ||
| "hyperpolymath/standards" | ||
| ) | ||
|
|
||
| # Filter to only repos that have .githooks directory | ||
| echo "🔍 Filtering repos with .githooks directory..." | ||
| REPOS_WITH_HOOKS=() | ||
| for repo in "${ALL_REPOS[@]}"; do | ||
| ORG=$(echo "$repo" | cut -d'/' -f1) | ||
| REPO_NAME=$(echo "$repo" | cut -d'/' -f2) | ||
|
|
||
| # Check if .githooks exists in the repo | ||
| if gh api /repos/$ORG/$REPO_NAME/contents/.githooks \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" 2>/dev/null | \ | ||
| jq -e '. | type == "array"' 2>/dev/null; then | ||
| REPOS_WITH_HOOKS+=("$repo") | ||
| echo " ✓ $repo has .githooks" | ||
| else | ||
| echo " ✗ $repo skipped (no .githooks)" | ||
| fi | ||
| done | ||
|
|
||
| REPOS_JSON=$(printf '%s\n' "${REPOS_WITH_HOOKS[@]}" | jq -R . | jq -s .) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Serialise an empty repository list as When Use 🤖 Prompt for AI Agents |
||
| fi | ||
|
|
||
| echo "repos=$REPOS_JSON" >> $GITHUB_OUTPUT | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Restore discovery of all propagation targets.
The default path now checks only
hyperpolymath/standards. It no longer includes the previously supported Hyperpolymath and Metadatastician target repositories. A normal run therefore updates only the source repository and skips all other repositories unless an operator setstarget-repo.Query and paginate the intended organisation repositories before filtering their
.githookspaths.🤖 Prompt for AI Agents