Multiple Self-hosted Github actions runners #26049
-
I have two self hosted github action runners -
Is there a way to select these runners based on which branch the Java CI action is being executed. so e.g. I want to run my master branch on the runner hosted in QA env and I want to run my feature branch run on the runner which is hosted in the dev env. Is there a way to do this. Currently I see that I can only use _ self-hosted _label but how can I choose -
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Hi @sgrmgj-quotient , Currently self hosted runner supports below labels:
For example, you can use below code to choose a macos self-hosted runner.
If your two runners used different OS/architecture, then they can be specified separately in your workflow. Github engineering team are going to support custom labels, should be completed by 31 March 2020. Let’s wait for the feature to be released, then you can use custom label to specify the self-hosted runner in workflow. You could keep an eye on Changelog site for the new features of Github Actions. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the reply. |
Beta Was this translation helpful? Give feedback.
-
how to add different type of linux distribution label on custom runner? |
Beta Was this translation helpful? Give feedback.
-
Custom labels are now available for self-hosted runners. https://github.blog/changelog/2020-04-22-github-actions-organization-level-self-hosted-runners/ |
Beta Was this translation helpful? Give feedback.
-
sgrmgj-quotient:
And most importantly: how do we enforce this assignment? Code in unmerged feature branches (including the workflow file itself) is untrusted, so any labels configured there cannot be relied upon. |
Beta Was this translation helpful? Give feedback.
-
You can use GitHub Actions matrix strategies to define a matrix of different job configurations. For e.g. you can create matrix of runner and git branch to use.
https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs |
Beta Was this translation helpful? Give feedback.
Hi @sgrmgj-quotient ,
Currently self hosted runner supports below labels:
For example, you can use below code to choose a macos self-hosted runner.
If your two runners used different OS/architecture, then they can be specified separately in your workflow.
Github engineering team are going to support custom labels, should be completed by 31 March 2020.
Let’s wait for the feature to be released, then you can use custom label to specify the self-hosted runner in wo…