microsoft / sqlmlutils

Utility functions for easier usage of SQL Server Machine Learning Services
Other
32 stars 33 forks source link

Enable Manually Triggering GitHub Action Workflow #96

Closed seantleonard closed 2 years ago

seantleonard commented 2 years ago

Summary

In order to support manually starting a GitHub action workflow from the CLI tool, REST API, or web UI, athe workflow's configuration must have the event workflow_dispatch defined. The usage of this event is described in this GitHub documentation article.

This will allow contributors to kick off an Action workflow in a feature branch prior to authoring a PR to merge into the default branch.

Usage

CLI

An example CLI command an admin may use to manually kickoff a workflow for a feature branch GitHub Reference

curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/microsoft/sqlmlutils/actions/workflows/ci.yaml/dispatches \
  -d '{"ref":"featureBranchName"}'

GitHub UI

The UI will look similar to the screenshot below which shows a Run Workflow button that allows defining the Run From branch and any additional defined parameter from the configuration: image