diff --git a/.github/workflows/update_licenses.yaml b/.github/workflows/update_licenses.yaml index 67dc8c7ad9..32acd8efeb 100644 --- a/.github/workflows/update_licenses.yaml +++ b/.github/workflows/update_licenses.yaml @@ -2,6 +2,34 @@ name: Update licenses on: workflow_dispatch: + inputs: + linux: + description: "Update licenses for Ubuntu" + type: boolean + required: false + default: true + mac_silicon: + description: "Update licenses for macOS (silicon)" + type: boolean + required: false + default: true + mac_intel: + description: "Update licenses for macOS (intel)" + type: boolean + required: false + default: true + +# Define the OS mapping object +osMap: + linux: + os_name: linux + os: ubuntu-20.04 + mac_silicon: + os_name: mac_silicon + os: macos-latest-xlarge + mac_intel: + os_name: mac_intel + os: macos-latest-large concurrency: group: "${{ github.ref }}-${{ github.event_name }}-${{ github.workflow }}" @@ -12,10 +40,7 @@ jobs: update_licenses: strategy: matrix: - config: - - {os_name: linux, os: ubuntu-20.04} - - {os_name: mac_intel, os: macos-latest-large} - - {os_name: mac_silicon, os: macos-latest-xlarge} + config: ${{ osMap[github.event.inputs.linux && 'linux'] || osMap[github.event.inputs.mac_silicon && 'mac_silicon'] || osMap[github.event.inputs.mac_intel && 'mac_intel'] }} runs-on: ${{ matrix.config.os }} defaults: