Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
mitchelbaker-cisa opened this issue Aug 6, 2024 · 1 comment · Fixed by #416
Closed
1 task
Assignees
Labels
Milestone

Comments

@mitchelbaker-cisa
Copy link
Collaborator

💡 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?

  • run_smoke_test.yml can be run manually with custom user input for os, python/opa versions. Otherwise use default values.
@mitchelbaker-cisa
Copy link
Collaborator Author

mitchelbaker-cisa commented Sep 17, 2024

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) }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants