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

feat: pass workflow inputs #8

Merged
merged 1 commit into from
Apr 21, 2022
Merged

feat: pass workflow inputs #8

merged 1 commit into from
Apr 21, 2022

Conversation

jenhagg
Copy link
Collaborator

@jenhagg jenhagg commented Apr 21, 2022

Purpose

We have workflows that can be run manually, via github's ui, which can have a user provided input. Main example is the docker image tag, where we can specify latest or stable. We also trigger these workflows from other ones, but don't have a way to override the default. Example: we want to publish the postreise:stable docker image when a new package is released to pypi, but have to run that manually because the default tag is latest. This PR fixes that by allowing a workflow to specify what a user would.

What the code is doing

Allow a workflow using this action to provide inputs to the target workflow (the one being triggered).

Testing

Tested in https://github.com/jenhagg/test-ci, both without the inputs and with a non default value.

Where to look

The commit history in the test-ci repo could be useful. Here are the docs about the REST API https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event

Time estimate

5 min, or more if you want to read the docs

@jenhagg jenhagg self-assigned this Apr 21, 2022
@jenhagg jenhagg added the enhancement New feature or request label Apr 21, 2022
Copy link
Collaborator

@rouille rouille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice

Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants