Skip to content

Conversation

@prince-deriv
Copy link
Collaborator

No description provided.

prince-deriv and others added 30 commits July 31, 2025 11:52
- AI Code Analysis: Analyzes AI-generated code in PRs with workflow_call support
- AI Dashboard: Tracks merged PRs and maintains AI usage dashboard
- Self-contained with included generate-dashboard.js script
- Comprehensive security validations and reusable inputs
Add ShiftAI workflows: AI code analysis and dashboard tracker
- Move ai-code-analysis.yml to .github/workflows/ (required by GitHub)
- Move ai-dashboard.yml to .github/workflows/ (required by GitHub)
- Move scripts to .github/scripts/ (correct path)
- Fixes: workflows must be defined at the top level of .github/workflows/
Fix workflow structure: Move to top-level workflows directory
- Move tokens from inputs to secrets section (GitHub requirement)
- PERSONAL_ACCESS_TOKEN now properly handled as secret
- GITHUB_TOKEN and SHIFTAI_TOKEN use secrets context
- Simplified inputs to only essential customizations
- Follows GitHub's security best practices
Fix workflows: Use proper secrets architecture
- Rename GITHUB_TOKEN to GH_TOKEN (GitHub reserves GITHUB_TOKEN)
- Fixes error: secret name GITHUB_TOKEN within workflow_call collides with system reserved name
- Maintains same functionality with non-reserved secret name
- Remove explicit secret definitions that aren't needed with inherit
- Use original GITHUB_TOKEN name (works with inherit)
- Cleaner calling syntax: just 'secrets: inherit'
- Maintains compatibility with explicit secret passing
Optimize for secrets: inherit pattern
- Remove undefined secrets.GITHUB_TOKEN references
- Use github.token which is always available
- Add test file with AI code blocks for testing
- Ready for production use with 'secrets: inherit'
Final fix: Use github.token directly for inherited secrets
- Remove workflow_call section entirely
- Let's see what the actual error is now
- Will add back with proper fix once we identify root cause
DEBUG: Temporarily disable workflow_call to isolate error
- Restore workflow_call section after debugging
- Only define PERSONAL_ACCESS_TOKEN in secrets
- Use github.token directly, no secrets.GITHUB_TOKEN reference
- Should fix Invalid secret GITHUB_TOKEN is not defined error
FIXED: Restore workflow_call with proper GITHUB_TOKEN handling
- Define GITHUB_TOKEN as optional secret to support secrets: inherit
- Required when caller uses secrets: inherit with GITHUB_TOKEN
- Should fix persistent Invalid secret GITHUB_TOKEN not defined error
Add GITHUB_TOKEN as optional secret for inherit compatibility
…llision

- Remove GITHUB_TOKEN from workflow_call secrets (GitHub reserved name)
- Keep only PERSONAL_ACCESS_TOKEN as required secret
- Use github.token directly in workflow (always available)
- Breaks the catch-22 loop - ready for production
- Add github_token as optional input to avoid reserved name collision
- Use inputs.github_token || github.token pattern
- Should finally resolve the persistent GITHUB_TOKEN validation error
- Avoids GitHub's secret reserved name restrictions
BREAKTHROUGH: Make GITHUB_TOKEN an input instead of secret
- Minimal reusable workflow to test basic functionality
- No complex logic, just echo statements
- Will help isolate if issue is workflow complexity or basic setup
Add simple test workflow for debugging
- Simple test workflow worked, confirming basic setup is fine
- Issue was specific to our complex AI workflow
- Ready to test actual AI workflow now
Remove test workflow - debugging complete
- Replace external script download with inline script creation
- Fixes 404 error when workflow tries to download from non-existent repo
- Remove separate .github/scripts/generate-dashboard.js file (no longer needed)
- Now works correctly in reusable workflow context
- Remove remaining pull_request_target trigger
- Now both workflows are pure reusable workflows
- No automatic execution on shared-actions repo
prince-deriv and others added 22 commits August 1, 2025 12:48
Fix: Convert template literals to string concatenation in dashboard s…
- Changed from date-only (2024-08-01) to date+time (2024-08-01 14:30:15 UTC)
- Ensures AI-DASHBOARD.md always has unique content on each run
- Prevents multiple runs on same day from generating identical content
- Now both history.json AND dashboard.md will be committed every time
Fix: Include time in dashboard timestamp to ensure updates
- Remove 'summary' object wrapper for consistency
- All entries now have percentage/totalCharacters/aiCharacters at root level
- Simplify data access logic (no more dual format handling)
- Workflow now always generates consistent format
- ✅ Eliminates TypeError: Cannot read properties of undefined
Normalize: Standardize data structure to root level format
- Parse structured JSON data from AI analysis comments
- Extract file details instead of hardcoding files: []
- Fallback to regex parsing if JSON extraction fails
- ✅ Test passed - files array now populated correctly
- Dashboard will show actual file counts and details
Fix: Extract files data from AI analysis JSON
- Replace problematic regex /[\s\S]*?/ that breaks in bash heredoc
- Use indexOf() and substring() for safer JSON extraction
- Eliminates shell escaping issues in YAML workflows
- ✅ Test passed - JSON parsing works without regex complexity
- Fixes: syntax error near unexpected token and eval syntax errors
Fix: Replace regex with safer string parsing for YAML heredoc
- Replace 'node -e "..."' with 'cat << EOF > script.js; node script.js'
- Eliminates bash trying to interpret JavaScript as shell commands
- ✅ Test passed: Real AI comment parsing works perfectly (1 file, 94 chars)
- Fixes: command not found errors and ReferenceError scope issues
- Resolves: Cannot access 'jsonStart' before initialization
Fix: Replace node -e with HERE documents to eliminate bash interference
- Remove problematic cat << 'EOF' ... EOF construct
- Replace with clean node -e command for inline JavaScript
- Fixes YAML syntax highlighting and validation issues
- Eliminates EOF terminator positioning problems
fix: Replace HERE document with node -e to fix YAML syntax
- Fix JSON extraction regex to properly handle newlines after ```json
- Replace flawed indexOf+substring approach with proper regex matching
- Add comprehensive debug logging to diagnose parsing issues
- Track comment length, JSON detection, and regex fallback values
fix: Improve JSON parsing and add debug logging for AI analysis
Revert "fix: Improve JSON parsing and add debug logging for AI analysis"
- Resolved conflicts by keeping job-level permissions
- Maintained environment variable usage for injection prevention
- Security enhancements from shiftai-workflows branch preserved
@github-actions
Copy link

github-actions bot commented Dec 24, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout b4ffde65f46336ab88eb53be808477a3936bae11 🟢 6.5
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 56 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Packaging⚠️ -1packaging workflow not detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Security-Policy🟢 9security policy file detected
Vulnerabilities🟢 91 existing vulnerabilities detected
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
SAST🟢 8SAST tool detected but not run on all commits
actions/actions/setup-node 60edb5dd545a775178f52524783378180af0d1f8 🟢 5.9
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 68 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 9binaries present in source code
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 1branch protection is not maximal on development and all release branches
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
Vulnerabilities🟢 82 existing vulnerabilities detected

Scanned Manifest Files

.github/workflows/dependonme-bot.yml

@prince-deriv prince-deriv deleted the dependonme-bot branch December 25, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants