Skip to content

[CI] Change branch workflows so that they are triggered only upon request or scheduled #17567

@lhotari

Description

@lhotari

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

We have many active branches and many commits are pushed to these branches. master branch gets commits by merging PRs and in most cases, commits are pushed by cherry-picking commits from master branch to maintenance branches (branch-2.11, branch-2.10, branch-2.9, branch-2.8 and branch-2.7).
In most cases, nobody pays attention to the results of individual builds for commits pushed to maintenance branches.

Therefore, it would be a way to save CI resources if CI builds are only available upon request or in a scheduled manner.

Solution

GitHub Actions has a feature for manually triggering the workflow. Documentation:
https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#defining-inputs-for-manually-triggered-workflows
workflow_dispatch is the event type. Docs for workflow_dispatch
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
The GitHub UI lets the user choose the branch. The minimum way to add support for manual triggering is adding on: workflow_dispatch to the workflow.

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions