Bird
0
0

You want to add a step in your Remix CI pipeline that only runs tests if the package.json file changed. Which condition syntax is correct?

hard📝 Application Q9 of 15
Remix - Testing
You want to add a step in your Remix CI pipeline that only runs tests if the package.json file changed. Which condition syntax is correct?
Aif: contains(github.event.head_commit.message, 'package.json')
Bif: contains(github.event.head_commit.modified, 'package.json')
Cif: github.event.head_commit.files.includes('package.json')
Dif: github.event_name == 'push' && contains(github.event.head_commit.message, 'package.json')
Step-by-Step Solution
Solution:
  1. Step 1: Understand GitHub event context

    'head_commit.modified' is an array of changed files in the push event.
  2. Step 2: Use contains function correctly

    Using 'contains' on 'head_commit.modified' array checks if 'package.json' changed.
  3. Final Answer:

    if: contains(github.event.head_commit.modified, 'package.json') -> Option B
  4. Quick Check:

    Condition to check changed files = if: contains(github.event.head_commit.modified, 'package.json') [OK]
Quick Trick: Use 'contains' on head_commit.modified to check changed files [OK]
Common Mistakes:
MISTAKES
  • Checking commit message instead of modified files
  • Using invalid syntax like .includes in YAML
  • Combining conditions incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes