generated from midnightntwrk/midnight-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 20
feat: add workflow configuration validation #446
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
Open
m2ux
wants to merge
8
commits into
main
Choose a base branch
from
feat/validate-prod-workflow-config
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…setup Update all GitHub Actions workflows to match package.json packageManager specification: - prod.yml: Add pre-setup corepack enable + update to [email protected] - build.yml: Update from [email protected] to [email protected] - pr.yml: Update from [email protected] to [email protected] - playwright-visual-regression.yml: Update from [email protected] to [email protected] Key changes: 1. All workflows now use [email protected] (matching package.json) 2. prod.yml now includes 'Enable Corepack (Pre-Setup)' step before actions/setup-node to match pr.yml pattern 3. The actions/setup-node action can interfere with corepack, so we enable it both before and after node setup Root cause analysis: - prod.yml only runs on push to main (not during PR review) - pr.yml and build.yml run on PRs and had correct config - This meant the issue wasn't detected until after merge Fixes CI error: 'This project's package.json defines packageManager: [email protected]. However the current global version of Yarn is 1.22.22.'
Create validate-workflow-config.yml to validate production workflow configuration during PR review before merge to main. Validation checks: - Verifies prod.yml has 'Enable Corepack (Pre-Setup)' step - Validates all workflows use yarn version from package.json This prevents configuration issues from reaching main branch that would only be detected after production deployment fails. Triggers on PRs that modify .github/workflows/** or package.json. Completes in < 30 seconds with clear error messages. WP: Workflow Configuration Validation (Task 1)
Document decision to add validation workflow that checks production workflow configuration during PR review. Decision rationale: - Prevents prod.yml configuration errors from reaching main - Fast feedback (< 30 seconds) during PR review - No external dependencies - Addresses specific issues from recent incident WP: Workflow Configuration Validation (Task 3)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🚀 Preview Deployment✅ Deployment Ready 🔗 Preview URL: https://pr-446-midnight-docs.vercel.app 📝 Latest commit: This preview updates automatically when you push new commits to this PR. |
Update validation logic to skip workflows where 'corepack prepare yarn@' text is found but no version can be extracted. This prevents false positives from the validation workflow itself, which contains the text in its validation logic but doesn't actually execute corepack. Fixes validation failure where validate-workflow-config.yml was incorrectly flagged as having wrong yarn version.
gilescope
reviewed
Dec 8, 2025
gilescope
reviewed
Dec 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Workflow Configuration Validation
Adds validation workflow to catch production workflow configuration errors during PR review, preventing issues from reaching main branch.
Problem: The
prod.ymlworkflow only runs after merge to main, so configuration errors are not detected until production deployment fails.Solution: Created
validate-workflow-config.ymlthat runs on PRs to verify configuration before merge.Key Benefits
What's New
Core Changes:
.github/workflows/validate-workflow-config.yml- New validation workflow (91 lines)Documentation:
docs/architecture/adr0003-workflow-validation.md- ADR documenting decision (171 lines)Validation Checks
Pre-Setup Corepack Pattern
Prevents: actions/setup-node interfering with corepack
Yarn Version Consistency
Prevents: Version mismatches causing CI failures
Example Output
Success:
Failure:
Testing
Files Changed
New Files:
.github/workflows/validate-workflow-config.yml(91 lines)docs/architecture/adr0003-workflow-validation.md(171 lines)Backward Compatibility
✅ 100% backward compatible - This is additive only. No changes to existing workflows or behavior. Simply adds validation that runs on PRs.
Related Work
ADR: docs/architecture/adr0003-workflow-validation.md