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

Ability to filter runner jobs based on branches #553

Closed
liamgib opened this issue May 19, 2021 · 1 comment
Closed

Ability to filter runner jobs based on branches #553

liamgib opened this issue May 19, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@liamgib
Copy link
Contributor

liamgib commented May 19, 2021

Is your feature request related to a problem? Please describe.
We have a private repo that follows a non-forking branching strategy.
Features are developed in personal feature branches and we have a primary branch and environment branches.

In GitHub, if a user creates a new workflow, they can use the runner against their own branch which is a security concern to using self-hosted runners. By this, the actions workflow does not need to be in the default (and approved) branch for it to run on the runner... which is bad.

This should really be introduced by Github, but the issue surrounding this has now been open for a year.
actions/runner#494

Describe the solution you'd like

It would be really good if we could register an actions runner with a list of 'allow_branches'... something like this:

apiVersion: actions.summerwind.dev/v1alpha1
kind: Runner
metadata:
  name: example-runner
spec:
  repository: summerwind/actions-runner-controller
  env: []
  allowed_branches: ['environment_branch']

When a job is triggered, if this field is present it would validate the trigger branch otherwise not accept the job.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@liamgib liamgib added the enhancement New feature or request label May 19, 2021
@mumoshu
Copy link
Collaborator

mumoshu commented May 19, 2021

@liamgib I hear you, but this isn't technically possible. You must fork https://github.com/actions/runner and enhance it to filter jobs not only on runner labels and groups but also branches . And we aren't actions/runner authors. In addition to that, not all github actions events have "branch" attribute so this doesn't really make sense to do externally.

@mumoshu mumoshu closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants