小编Ica*_*rus的帖子

基于输入的多个条件的 GitHub Actions 作业

我一直在尝试在 GitHub Actions 中为作业创造条件,但似乎无法让它发挥作用

我有以下输入:

on:
  workflow_dispatch:
    inputs:
      env:
        description: 'Select the Environment'
        type: choice
        required: true
        options:
        - SIT
        - UAT
      op:
        description: 'Deploy or Delete Apps'
        type: choice
        required: true
        options:
        - Deploy
        - Delete
      ver:
        description: 'Type the app version'
        required: true
Run Code Online (Sandbox Code Playgroud)

以及以下职位:

jobs:
  create-sit-app:
    runs-on: ubuntu-latest
    name: 'Deploy App for SIT'
    if: |
      (${{ github.event.inputs.env }} == 'SIT' && ${{ github.event.inputs.op }} == 'Deploy')

    steps:
........
........
........
Run Code Online (Sandbox Code Playgroud)

我也尝试过这个

(${{ github.event.inputs.env == 'SIT' }} && ${{ …
Run Code Online (Sandbox Code Playgroud)

yaml action github-actions

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

标签 统计

action ×1

github-actions ×1

yaml ×1