Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 7, 2026

Plan: Update agentics-maintenance job to create issue for outdated workflows

Understanding

  • The maintenance workflow is auto-generated by pkg/workflow/maintenance_workflow.go
  • It currently has a compile-workflows job that checks for out-of-sync workflows
  • Currently exits with error if workflows are out of sync
  • Need to create an issue with agentic instructions instead

Implementation Complete ✅

  • Investigate existing structure and patterns
  • Create JavaScript file check_workflow_recompile_needed.cjs in actions/setup/js
    • Search for existing open issue about recompiling workflows
    • If found, add comment (don't create duplicate)
    • If not found and workflows are out of sync, create issue with agentic instructions
  • Update maintenance_workflow.go to use the new JavaScript script
    • Modify compile-workflows job to use the JavaScript script
    • Add necessary permissions (issues: write)
    • Add setup steps for actions/setup custom action
  • Test the implementation
    • Created comprehensive test file with 4 test cases
    • All tests pass (125 test files, 2491 tests passed)
  • Run final validation
    • All JavaScript tests pass
    • Formatting applied
    • Linting passes
  • Verify generated maintenance workflow
    • Workflow correctly includes new check step
    • Uses GitHub API to create issues
    • Includes agentic instructions for Copilot
  • Updated checkout strategy (per review feedback)
    • Dev mode: Checkout entire repository with persist-credentials: false
    • Release mode: Sparse checkout of .github folder with persist-credentials: false

Key Features Implemented

  1. Duplicate Prevention: Searches for existing open issues before creating new ones
  2. Comment on Existing Issues: If issue exists, adds a comment with new workflow run details
  3. Agentic Instructions: Creates issues with clear instructions for GitHub Copilot to fix
  4. Error Handling: Gracefully handles errors with proper logging
  5. Comprehensive Testing: 4 test cases covering all scenarios (no changes, existing issue, new issue, errors)
  6. Optimized Checkout Strategy:
    • Dev mode: Full repository checkout (needed for building)
    • Release mode: Sparse checkout of .github folder only
    • Both modes use persist-credentials: false for security
Original prompt

Update the agentics maintenance job that checks if workflow needs to be recompiled.

If it is detected that the workflows are outdated, the job should create an issue with contains the agentic instructions for copilot to recompile the workflows.

  • searches if there is already an issue about recompiling, if so cancel
  • create issue using GitHub object

Use a JavaScript script that is store in actions/setup/js deployed with the actions/setup custom action


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 7, 2026 21:01
- Created JavaScript script to check for outdated workflows and create issues
- Updated maintenance_workflow.go to use the new JavaScript script
- Added comprehensive tests for the new functionality
- Script searches for existing issues to avoid duplicates
- Creates issues with agentic instructions for GitHub Copilot

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update agentics maintenance job for workflow recompilation Create issues with agentic instructions when workflows need recompilation Jan 7, 2026
Copilot AI requested a review from pelikhan January 7, 2026 21:11
@pelikhan pelikhan marked this pull request as ready for review January 7, 2026 21:54
Updated the compile-workflows job checkout step to use sparse-checkout for
.github folder instead of full repository checkout, and added
persist-credentials: false for security.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan January 7, 2026 22:22
@pelikhan
Copy link
Contributor

pelikhan commented Jan 7, 2026

@copilot in development mode in the compile-workflows job, checkout the entire repository. in release mode, checkout the .github folder (sparse in both case, no credentials)

…lease mode

In dev mode, checkout the entire repository (needed for building).
In release mode, use sparse checkout of only .github folder.
Both modes use persist-credentials: false for security.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 7, 2026

@copilot in development mode in the compile-workflows job, checkout the entire repository. in release mode, checkout the .github folder (sparse in both case, no credentials)

Done in abd6e65. Dev mode now checks out the entire repository, release mode uses sparse checkout of .github folder. Both use persist-credentials: false.

@pelikhan pelikhan merged commit 15b8db8 into main Jan 7, 2026
48 checks passed
@pelikhan pelikhan deleted the copilot/update-agentics-maintenance-job branch January 7, 2026 22:52
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