小编Rom*_*din的帖子

GitHub Actions: How to override the default matrix with workflow_dispatch inputs?

If I want to let a user override the default values in the matrix, how do I do that?

Consider the following simplified example:

name: CICD
on:
  push:
    branches:
      - main
  workflow_dispatch:
    inputs:
      py_version:
        description: "Python version"
        default: "3.11"

jobs:
  test:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        py_version: [3.7, 3.10]
    steps:
      - uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.py_version }}
Run Code Online (Sandbox Code Playgroud)

I want to let a user override the py_version matrix list with the list provided in the workflow_dispatch input. Is there a way? …

github-actions

3
推荐指数
1
解决办法
1347
查看次数

标签 统计

github-actions ×1