require-aws-amplify-config-file
Require an AWS Amplify build specification to be committed in the repository.
Targeted pattern scopeâ
- Repositories that opt into the AWS preset but do not commit
amplify.ymloramplify.yaml.
What this rule reportsâ
This rule reports repositories using the AWS preset when no Amplify build spec is committed.
Why this rule existsâ
Keeping the Amplify build spec in version control makes build phases, cache behavior, and published artifacts reviewable in pull requests instead of living only in the Amplify dashboard.
â Incorrectâ
// Repository uses AWS Amplify but does not commit amplify.yml.
export default [];
â Correctâ
# amplify.yml
version: 1
frontend:
phases:
build:
commands:
- npm ci
- npm run build
artifacts:
baseDirectory: dist
files:
- "**/*"
When not to use itâ
Disable this rule if AWS hosting is managed outside Amplify or the repository intentionally does not use an Amplify build spec.
Rule catalog ID: R062