Bird
0
0

Which of the following is the correct syntax to trigger a GitHub Actions workflow on every push to the main branch?

easy📝 Syntax Q12 of 15
Remix - Testing
Which of the following is the correct syntax to trigger a GitHub Actions workflow on every push to the main branch?
Awhen: push to main
Btrigger: push main
Con: push: branches: [main]
Devent: push branch main
Step-by-Step Solution
Solution:
  1. Step 1: Review GitHub Actions trigger syntax

    The correct YAML syntax uses 'on:' followed by the event and branches list.
  2. Step 2: Match syntax to options

    on: push: branches: [main] matches the correct YAML format: 'on: push: branches: [main]'. Others are invalid syntax.
  3. Final Answer:

    on: push: branches: [main] -> Option C
  4. Quick Check:

    GitHub Actions trigger = on: push: branches: [main] [OK]
Quick Trick: GitHub Actions triggers start with 'on:' keyword [OK]
Common Mistakes:
MISTAKES
  • Using 'trigger' instead of 'on'
  • Missing YAML indentation
  • Writing event as plain text

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes