Skip to content

Commit 63d2213

Browse files
fix(rhodium-standard-repositories): use reusable workflows from root
- rhodium-standard-repositories/.github/workflows/: 8 workflow files updated - All now use ../root reusable workflows (codeql, governance, hypatia-scan, mirror, scorecard, secret-scanner) or standardized version (instant-sync) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
1 parent e583bbc commit 63d2213

8 files changed

Lines changed: 117 additions & 492 deletions

File tree

Lines changed: 13 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,23 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
# For most projects, this workflow file will not need changing; you simply need
3-
# to commit it to your repository.
4-
#
5-
# You may wish to alter this file to override the set of languages analyzed,
6-
# or to provide custom queries or build logic.
7-
#
8-
# ******** NOTE ********
9-
# We have attempted to detect the languages in your repository. Please check
10-
# the `language` matrix defined below to confirm you have the correct set of
11-
# supported CodeQL languages.
12-
#
13-
name: "CodeQL Advanced"
2+
name: CodeQL Security Analysis
143

154
on:
165
push:
17-
branches: [ "main" ]
6+
branches: [main, master]
187
pull_request:
19-
branches: [ "main" ]
8+
branches: [main, master]
209
schedule:
21-
- cron: '19 20 * * *'
10+
- cron: '0 6 1 * *'
2211

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: false
2315

24-
25-
permissions: read-all
16+
permissions:
17+
contents: read
2618

2719
jobs:
28-
analyze:
29-
name: Analyze (${{ matrix.language }})
30-
# Runner size impacts CodeQL analysis time. To learn more, please see:
31-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
32-
# - https://gh.io/supported-runners-and-hardware-resources
33-
# - https://gh.io/using-larger-runners (GitHub.com only)
34-
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
35-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
36-
timeout-minutes: 30
37-
permissions:
38-
# required for all workflows
39-
security-events: write
40-
41-
# required to fetch internal or private CodeQL packs
42-
packages: read
43-
44-
# only required for workflows in private repositories
45-
actions: read
46-
contents: read
47-
48-
strategy:
49-
fail-fast: false
50-
matrix:
51-
include:
52-
- language: javascript-typescript
53-
build-mode: none
54-
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
55-
# Use `c-cpp` to analyze code written in C, C++ or both
56-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
57-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
58-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
59-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
60-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
61-
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
62-
steps:
63-
- name: Checkout repository
64-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
65-
66-
# Add any setup steps before running the `github/codeql-action/init` action.
67-
# This includes steps like installing compilers or runtimes (`actions/setup-node`
68-
# or others). This is typically only required for manual builds.
69-
# - name: Setup runtime (example)
70-
# uses: actions/setup-example@v1
71-
72-
# Initializes the CodeQL tools for scanning.
73-
- name: Initialize CodeQL
74-
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169
75-
with:
76-
languages: ${{ matrix.language }}
77-
build-mode: ${{ matrix.build-mode }}
78-
# If you wish to specify custom queries, you can do so here or in a config file.
79-
# By default, queries listed here will override any specified in a config file.
80-
# Prefix the list here with "+" to use these queries and those in the config file.
81-
82-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
83-
# queries: security-extended,security-and-quality
84-
85-
# If the analyze step fails for one of the languages you are analyzing with
86-
# "We were unable to automatically build your code", modify the matrix above
87-
# to set the build mode to "manual" for that language. Then modify this step
88-
# to build your code.
89-
# ℹ️ Command-line programs to run using the OS shell.
90-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
91-
- name: Run manual build steps
92-
if: matrix.build-mode == 'manual'
93-
shell: bash
94-
run: |
95-
echo 'If you are using a "manual" build mode for one or more of the' \
96-
'languages you are analyzing, replace this with the commands to build' \
97-
'your code, for example:'
98-
echo ' make bootstrap'
99-
echo ' make release'
100-
exit 1
101-
102-
- name: Perform CodeQL Analysis
103-
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169
104-
with:
105-
category: "/language:${{matrix.language}}"
20+
analyze-js:
21+
uses: ../.github/workflows/codeql-reusable.yml
22+
with:
23+
language: javascript-typescript

rhodium-standard-repositories/.github/workflows/governance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ permissions:
2323

2424
jobs:
2525
governance:
26-
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@861b5e911d9e5dcfb3c0ab3dd2a9a3c8fd0a1613
26+
uses: ../.github/workflows/governance-reusable.yml
Lines changed: 9 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -1,180 +1,21 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
# Hypatia Neurosymbolic CI/CD Security Scan
32
name: Hypatia Security Scan
43

54
on:
65
push:
7-
branches: [ main, master, develop ]
6+
branches: [main, master, develop]
87
pull_request:
9-
branches: [ main, master ]
8+
branches: [main, master]
109
schedule:
11-
- cron: '0 0 * * 0' # Weekly on Sunday
10+
- cron: '0 0 * * 0'
1211
workflow_dispatch:
1312

14-
permissions: read-all
13+
permissions:
14+
actions: read
15+
contents: read
16+
security-events: write
1517

1618
jobs:
1719
scan:
18-
name: Hypatia Neurosymbolic Analysis
19-
runs-on: ubuntu-latest
20-
timeout-minutes: 20
21-
22-
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
25-
with:
26-
fetch-depth: 0 # Full history for better pattern analysis
27-
28-
- name: Setup Elixir for Hypatia scanner
29-
uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.18.2
30-
with:
31-
elixir-version: '1.18'
32-
otp-version: '27'
33-
34-
- name: Clone Hypatia
35-
run: |
36-
if [ ! -d "$HOME/hypatia" ]; then
37-
git clone https://github.com/hyperpolymath/hypatia.git "$HOME/hypatia"
38-
fi
39-
40-
- name: Build Hypatia scanner (if needed)
41-
working-directory: ${{ env.HOME }}/hypatia
42-
run: |
43-
if [ ! -f hypatia-v2 ]; then
44-
echo "Building hypatia-v2 scanner..."
45-
cd scanner
46-
mix deps.get
47-
mix escript.build
48-
mv hypatia ../hypatia-v2
49-
fi
50-
51-
- name: Run Hypatia scan
52-
id: scan
53-
run: |
54-
echo "Scanning repository: ${{ github.repository }}"
55-
56-
# Run scanner
57-
HYPATIA_FORMAT=json "$HOME/hypatia/hypatia-cli.sh" scan . > hypatia-findings.json
58-
59-
# Count findings
60-
FINDING_COUNT=$(jq '. | length' hypatia-findings.json 2>/dev/null || echo 0)
61-
echo "findings_count=$FINDING_COUNT" >> $GITHUB_OUTPUT
62-
63-
# Extract severity counts
64-
CRITICAL=$(jq '[.[] | select(.severity == "critical")] | length' hypatia-findings.json)
65-
HIGH=$(jq '[.[] | select(.severity == "high")] | length' hypatia-findings.json)
66-
MEDIUM=$(jq '[.[] | select(.severity == "medium")] | length' hypatia-findings.json)
67-
68-
echo "critical=$CRITICAL" >> $GITHUB_OUTPUT
69-
echo "high=$HIGH" >> $GITHUB_OUTPUT
70-
echo "medium=$MEDIUM" >> $GITHUB_OUTPUT
71-
72-
echo "## Hypatia Scan Results" >> $GITHUB_STEP_SUMMARY
73-
echo "- Total findings: $FINDING_COUNT" >> $GITHUB_STEP_SUMMARY
74-
echo "- Critical: $CRITICAL" >> $GITHUB_STEP_SUMMARY
75-
echo "- High: $HIGH" >> $GITHUB_STEP_SUMMARY
76-
echo "- Medium: $MEDIUM" >> $GITHUB_STEP_SUMMARY
77-
78-
- name: Upload findings artifact
79-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
80-
with:
81-
name: hypatia-findings
82-
path: hypatia-findings.json
83-
retention-days: 90
84-
85-
- name: Submit findings to gitbot-fleet (Phase 2)
86-
if: steps.scan.outputs.findings_count > 0
87-
env:
88-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89-
GITHUB_REPOSITORY: ${{ github.repository }}
90-
GITHUB_SHA: ${{ github.sha }}
91-
run: |
92-
echo "📤 Submitting ${{ steps.scan.outputs.findings_count }} findings to gitbot-fleet..."
93-
94-
# Clone gitbot-fleet to temp directory
95-
FLEET_DIR="/tmp/gitbot-fleet-$$"
96-
git clone https://github.com/hyperpolymath/gitbot-fleet.git "$FLEET_DIR"
97-
98-
# Run submission script
99-
bash "$FLEET_DIR/scripts/submit-finding.sh" hypatia-findings.json
100-
101-
# Cleanup
102-
rm -rf "$FLEET_DIR"
103-
104-
echo "✅ Finding submission complete"
105-
106-
- name: Check for critical issues
107-
if: steps.scan.outputs.critical > 0
108-
run: |
109-
echo "⚠️ Critical security issues found!"
110-
echo "Review hypatia-findings.json for details"
111-
# Don't fail the build yet - just warn
112-
# exit 1
113-
114-
- name: Generate scan report
115-
run: |
116-
cat << EOF > hypatia-report.md
117-
# Hypatia Security Scan Report
118-
119-
**Repository:** ${{ github.repository }}
120-
**Scan Date:** $(date -u +"%Y-%m-%d %H:%M:%S UTC")
121-
**Commit:** ${{ github.sha }}
122-
123-
## Summary
124-
125-
| Severity | Count |
126-
|----------|-------|
127-
| Critical | ${{ steps.scan.outputs.critical }} |
128-
| High | ${{ steps.scan.outputs.high }} |
129-
| Medium | ${{ steps.scan.outputs.medium }} |
130-
| **Total**| ${{ steps.scan.outputs.findings_count }} |
131-
132-
## Next Steps
133-
134-
1. Review findings in the artifact: hypatia-findings.json
135-
2. Auto-fixable issues will be addressed by robot-repo-automaton (Phase 3)
136-
3. Manual review required for complex issues
137-
138-
## Learning
139-
140-
These findings feed Hypatia's learning engine to improve future rules.
141-
142-
---
143-
*Powered by [Hypatia](https://github.com/hyperpolymath/hypatia) - Neurosymbolic CI/CD Intelligence*
144-
EOF
145-
146-
cat hypatia-report.md >> $GITHUB_STEP_SUMMARY
147-
148-
- name: Comment on PR with findings
149-
if: github.event_name == 'pull_request' && steps.scan.outputs.findings_count > 0
150-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
151-
with:
152-
script: |
153-
const fs = require('fs');
154-
const findings = JSON.parse(fs.readFileSync('hypatia-findings.json', 'utf8'));
155-
156-
const critical = findings.filter(f => f.severity === 'critical').length;
157-
const high = findings.filter(f => f.severity === 'high').length;
158-
159-
let comment = `## 🔍 Hypatia Security Scan\n\n`;
160-
comment += `**Findings:** ${findings.length} issues detected\n\n`;
161-
comment += `| Severity | Count |\n|----------|-------|\n`;
162-
comment += `| 🔴 Critical | ${critical} |\n`;
163-
comment += `| 🟠 High | ${high} |\n`;
164-
comment += `| 🟡 Medium | ${findings.length - critical - high} |\n\n`;
165-
166-
if (critical > 0) {
167-
comment += `⚠️ **Action Required:** Critical security issues found!\n\n`;
168-
}
169-
170-
comment += `<details><summary>View findings</summary>\n\n`;
171-
comment += `\`\`\`json\n${JSON.stringify(findings.slice(0, 10), null, 2)}\n\`\`\`\n`;
172-
comment += `</details>\n\n`;
173-
comment += `*Powered by Hypatia Neurosymbolic CI/CD Intelligence*`;
174-
175-
github.rest.issues.createComment({
176-
owner: context.repo.owner,
177-
repo: context.repo.repo,
178-
issue_number: context.issue.number,
179-
body: comment
180-
});
20+
uses: ../.github/workflows/hypatia-scan-reusable.yml
21+
secrets: inherit
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Instant Forge Sync - Triggers propagation to all forges on push/release
3+
name: Instant Sync
4+
5+
on:
6+
push:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
11+
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
12+
# updates do not pile up queued runs against the shared account-wide
13+
# Actions concurrency pool. Applied only to read-only check workflows
14+
# (no publish/mutation), so cancelling a superseded run is always safe.
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
permissions:
20+
actions: read
21+
contents: read
22+
23+
jobs:
24+
dispatch:
25+
timeout-minutes: 10
26+
runs-on: ubuntu-latest
27+
# Map the secret to env so step `if:`s can gate on its presence: the
28+
# `secrets` context is NOT available in `if:` (using it is an
29+
# "Unrecognized named-value: 'secrets'" startup failure). `env` IS
30+
# available in step `if:`, and secrets are valid in job-level `env`.
31+
env:
32+
FARM_DISPATCH_TOKEN: ${{ secrets.FARM_DISPATCH_TOKEN }}
33+
steps:
34+
# Gate the cross-repo repository_dispatch on FARM_DISPATCH_TOKEN
35+
# being configured. Without the PAT, peter-evans/repository-dispatch
36+
# falls back to GITHUB_TOKEN — which cannot dispatch cross-repo and
37+
# returns HTTP 401 "Bad credentials", failing the job. Caught 39
38+
# estate repos on the 2026-05-30 audit. With this gate the workflow
39+
# gracefully skips on repos where the secret has not been
40+
# propagated, instead of red-ing main on every push.
41+
- name: Trigger Propagation
42+
if: ${{ env.FARM_DISPATCH_TOKEN != '' }}
43+
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v3
44+
with:
45+
token: ${{ secrets.FARM_DISPATCH_TOKEN }}
46+
repository: hyperpolymath/.git-private-farm
47+
event-type: propagate
48+
client-payload: |-
49+
{
50+
"repo": "${{ github.event.repository.name }}",
51+
"ref": "${{ github.ref }}",
52+
"sha": "${{ github.sha }}",
53+
"forges": ""
54+
}
55+
56+
- name: Skipped (FARM_DISPATCH_TOKEN not configured)
57+
if: ${{ env.FARM_DISPATCH_TOKEN == '' }}
58+
env:
59+
REPO_NAME: ${{ github.event.repository.name }}
60+
run: |
61+
echo "::notice::FARM_DISPATCH_TOKEN secret not configured on ${REPO_NAME}; skipping cross-repo dispatch. Configure the org-level FARM_DISPATCH_TOKEN PAT (repo scope) to enable instant forge propagation."
62+
63+
- name: Confirm
64+
env:
65+
REPO_NAME: ${{ github.event.repository.name }}
66+
run: echo "::notice::Propagation triggered for ${REPO_NAME}"

0 commit comments

Comments
 (0)