Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional runs on branch/ref #73

Open
simonerota opened this issue Jul 30, 2019 · 4 comments
Open

Conditional runs on branch/ref #73

simonerota opened this issue Jul 30, 2019 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@simonerota
Copy link
Collaborator

It would be nice to be able to specify an include/exclude filter (regex?) on branches or refs to include or exclude runs on a project.
Example: for a project I'd like to only start a run if the branch name is 'master' or 'release'.

@sgotti sgotti added enhancement New feature or request good first issue Good for newcomers labels Aug 1, 2019
@sgotti
Copy link
Member

sgotti commented Aug 1, 2019

@simonerota This should be implemented in two places:

  • At the config level: add a When field to the run definition like already done for tasks. So users could define when to execute a run (remember that there can be more than one run defined and every run can have different when conditions).

  • As a project config (something like RunWhen). This will happen just after receiving a webhook if the conditions isn't met nothing will be done (the config file is not even fetched).

@sgotti
Copy link
Member

sgotti commented Aug 2, 2019

First task implemented in #78

@huapox
Copy link

huapox commented Nov 4, 2019

Perfect, I'll try test this latter.

@huapox
Copy link

huapox commented Dec 4, 2019

  • Test Result:
local task_gitsrc() = {
    name: 'git-src',
    runtime: {
      arch: 'amd64',
      containers: [{image: 'alpine/git'}],
    },
    steps: steps_gitsrc(),
    depends: [],
    when: {
      // branch: '#.*#',
      branch: '#master#',
      ref: '#refs/pull/\\d+/head#',
    },

选区_390_agolaWhenTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants