Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vbem committed Oct 2, 2023
1 parent fc348a8 commit 04fb363
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,13 @@ You can delete an existing runner by its Linux username.
```bash
./mr.bash del --user <runner-?>
```

### Specify runner in workflow file
In [`jobs.<job_id>.runs-on`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on), target runners can be based on the labels as follows via [GitHub context](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context):
```yaml
# For organization level self-hosted runners
runs-on: [self-hosted, ${{ github.repository_owner }}]

# For repository level self-hosted runners
runs-on: [self-hosted, ${{ github.repository }}]
```
4 changes: 2 additions & 2 deletions mr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ function mr::addRunner {

local name="$user@$HOSTNAME"

local labels="controller:vbem/multi-runners,username:$user,hostname:$HOSTNAME,org:$org"
[[ -n "$repo" ]] && labels="$labels,repo:$repo"
local labels="controller:$USER@$HOSTNAME:$DIR_THIS/$FILE_THIS"
[[ -r /etc/os-release ]] && labels="$labels,os:$(source /etc/os-release && echo $ID-$VERSION_ID)"
[[ -n "$repo" ]] && labels="$labels,$org/$repo" || labels="$labels,$org"
[[ -n "$extraLabels" ]] && labels="$labels,$extraLabels"

local url=''
Expand Down

0 comments on commit 04fb363

Please sign in to comment.