cisagov / ScubaGoggles

SCuBA Secure Configuration Baselines and assessment tool for Google Workspace
https://www.cisa.gov/resources-tools/services/secure-cloud-business-applications-scuba-project
Creative Commons Zero v1.0 Universal
148 stars 19 forks source link

Update run_smoke_test.yml with ability to intake user inputs from workflow dispatch #340

Open mitchelbaker-cisa opened 1 month ago

mitchelbaker-cisa commented 1 month ago

💡 Summary

The run_smoke_test.yml workflow runs when pull requests are opened/synchronized and on pushes to main. After the initial PR is merged, we can expand the workflow_dispatch functionality to accommodate user input.

Motivation and context

One drawback with the current implementation is hardcoded values in the workflow. The workflow would be more dynamic if a user can specify comma-delimited values for the os, python version, and opa version for further testing.

Screenshot (161)_LI

Implementation notes

Add inputs under workflow_dispatch, which can be accessed in the workflow with ${{ inputs.name }}. Below is an example from one of ScubaGear's workflows:

on:
  workflow_dispatch:
    inputs:
      OverrideModuleVersion:
        description: "Always enter the release version in semantic version format, Major.Minor.Patch (e.g., 1.3.0):"
        required: false
        type: string
      IsPrerelease:
        description: "If pre-release, check here:"
        required: false
        type: boolean
        default: false

Acceptance criteria

How do we know when this work is done?

mitchelbaker-cisa commented 1 day ago

Array input types are not currently supported, despite many requests for the feature. Current workaround is to convert string types, ie "['windows-latest', 'macos-latest']" to an array using GitHub's built-in fromJSON method which can then be referenced within the workflow like so:

matrix:
  os: ${{ fromJSON(inputs.os) }}