Closed4
ブランチによってgithub actionsのランナーを動的に切り替える

ができるか調査する

ランナーの種類
ということで
- test1ブランチ:ubuntu-24.04
- test2ブランチ:ubuntu-22.04
- test3ブランチ:ubuntu-20.04
のように起動させようと思う

よさそうな参考

できたもの
name: Dynamic Runner Selection
on:
pull_request:
jobs:
build:
runs-on: >-
${{
github.base_ref == 'test1' && 'ubuntu-24.04' ||
github.base_ref == 'test2' && 'ubuntu-22.04' ||
github.base_ref == 'test3' && 'ubuntu-20.04' ||
'ubuntu-latest'
}}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run a sample command
run: echo "Running on ${{ runner.os }} ${{ runner.name }}"
このスクラップは2024/09/25にクローズされました