Skip to content

Conversation

@jmlrt
Copy link
Member

@jmlrt jmlrt commented Jan 13, 2026

This PR updates all three product workflows (elasticsearch, kibana, and logstash) to automatically work with all branches without requiring manual branch list maintenance.

Changes

  • Remove explicit branch lists from push and pull_request triggers
  • Add directory existence checks before building Docker images
  • Skip build step when directories don't exist (e.g., on main branch or PRs based on main)
  • Add comments explaining the directory check is needed because main branch doesn't contain Dockerfiles (see README.md for branch model)

Benefits

  • No manual maintenance - workflows automatically work for current and future version branches
  • Handles main branch - gracefully skips builds when Dockerfiles aren't present
  • Consistent behavior - same logic for push and pull_request events
  • Self-documenting - comments explain why the check exists

How it works

  1. Workflows trigger on all pushes and pull requests
  2. Check if the product directory (elasticsearch/kibana/logstash) exists
  3. Only build if the directory exists
  4. This allows workflows to run on any branch while skipping builds when appropriate

All three workflows (elasticsearch, kibana, and logstash) are now consistently configured and will automatically work for any version branch without requiring manual updates.

jmlrt added 4 commits January 13, 2026 13:13
- Remove explicit branch list from pull_request trigger
- Add condition to skip workflow when PR targets main branch
- This avoids needing to maintain branch list for each new/deprecated version
- Remove explicit branch list from push trigger
- Use branches-ignore to exclude main branch
- Workflow now triggers on pushes to all branches except main
- Add branches-ignore: ['main'] to pull_request trigger
- Remove unnecessary condition from build job
- Both push and pull_request now consistently exclude main at the trigger level
…t main

- Remove explicit branch lists from push and pull_request triggers
- Add branches-ignore: ['main'] to both triggers for consistency
- Workflows now automatically work for all version branches without manual updates
@jmlrt jmlrt changed the title Update elasticsearch workflow to trigger on all PRs except main Update workflows to trigger on all branches except main Jan 13, 2026
jmlrt added 5 commits January 13, 2026 13:20
- Remove branches-ignore from pull_request (not reliable for PR events)
- Add job-level condition to skip when PR targets main
- Condition handles both push and pull_request events correctly
- Add check step to verify dockerfile directory exists before building
- Skip build step if directory doesn't exist (e.g., on main branch or PRs based on main)
- Prevents workflow failures when directories are not present
- Remove job-level condition since directory check handles all cases
- Keep branches-ignore for push to prevent unnecessary workflow runs on main
- Directory existence check is now the single source of truth for builds
- Remove branches-ignore from push trigger
- Directory existence check is now the single source of truth
- Simpler and more maintainable - no need to maintain branch exclusion logic
- Add comment explaining directory check is needed because main branch doesn't contain Dockerfiles
- Reference README.md for branch model documentation
- Improves code maintainability and understanding
@jmlrt jmlrt changed the title Update workflows to trigger on all branches except main Update workflows to automatically handle all branches with directory checks Jan 13, 2026
@jmlrt jmlrt marked this pull request as ready for review January 13, 2026 12:28
@jmlrt jmlrt requested a review from a team as a code owner January 13, 2026 12:28
@jmlrt jmlrt requested review from StamatisKourk and alina-bacalete and removed request for a team January 13, 2026 12:28
@jmlrt jmlrt enabled auto-merge (squash) January 13, 2026 12:58
Copy link

@alina-bacalete alina-bacalete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ty

@jmlrt jmlrt merged commit 3b01a0b into main Jan 13, 2026
7 checks passed
@jmlrt jmlrt deleted the update-elasticsearch-workflow-triggers branch January 13, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants