-
-
Notifications
You must be signed in to change notification settings - Fork 0
GitHub Actions: Use YAML anchors #98
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
Conversation
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.
Pull request overview
This PR attempts to use YAML anchors (&matrix) and aliases (*matrix) to eliminate duplication of the matrix strategy configuration between the build and e2e jobs. However, GitHub Actions workflows do not support YAML anchors and aliases, making this change non-functional.
Key Changes
- Added a YAML anchor
&matrixto the matrix strategy in thebuildjob - Replaced the duplicated matrix definition in the
e2ejob with a YAML alias*matrix
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| needs: phar | ||
| strategy: | ||
| matrix: | ||
| matrix: &matrix |
Copilot
AI
Dec 7, 2025
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.
GitHub Actions does not support YAML anchors and aliases. While the YAML syntax &matrix is valid YAML, GitHub Actions workflow parser will not process this anchor, and the subsequent alias reference *matrix on line 160 will fail. This will cause the workflow to fail when it runs.
To avoid duplication, consider one of these alternatives:
- Use a reusable workflow to share common matrix configurations
- Keep the matrix definition duplicated in both jobs (current working approach)
- Use a composite action if the entire job logic can be shared
| variant: darwin_arm64 | ||
| - runs-on: macos-15-intel | ||
| variant: darwin_amd64 | ||
| matrix: *matrix |
Copilot
AI
Dec 7, 2025
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.
This YAML alias reference *matrix will not work in GitHub Actions workflows. GitHub Actions does not support YAML anchors and aliases, so this reference to the anchor defined on line 90 will fail, causing the workflow to error.
The matrix configuration needs to be explicitly defined here, as it was before this change.
| matrix: *matrix | |
| matrix: | |
| include: | |
| - runs-on: ubuntu-24.04-arm | |
| variant: linux_arm64 | |
| spc-variant: linux-aarch64 | |
| - runs-on: ubuntu-24.04 | |
| variant: linux_amd64 | |
| spc-variant: linux-x86_64 | |
| - runs-on: macos-15 | |
| variant: darwin_arm64 | |
| spc-variant: macos-aarch64 | |
| - runs-on: macos-15-intel | |
| variant: darwin_amd64 | |
| spc-variant: macos-x86_64 |
No description provided.