-
Notifications
You must be signed in to change notification settings - Fork 119
Closed as not planned
Labels
questionFurther information is requestedFurther information is requested
Description
Question
How does conditional execution in GitHub Actions determine whether a step runs on a specific branch?
What have you tried?
I created a conditional workflow that runs a deploy step only when pushing to the main branch using:
if: github.ref == 'refs/heads/main'
I tested it by pushing to both develop and main branches and observed the different behavior.
Relevant Documentation
Link any relevant documentation you've read:
Code Example
- name: Deploy (main only)
if: github.ref == 'refs/heads/main'
run: echo "Deploying to production..."
# Your code hereEnvironment
- Node.js Version: [18.x]
- Operating System: [Windows]
- Browser: [Chrome]
Additional Context
This issue was created as part of Advanced Task 10 to demonstrate usage of issue templates.
Don't hesitate to ask! We're here to help! 🤝
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested