Skip to content

Update events-that-trigger-workflows.md #650

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

Merged
merged 5 commits into from
Nov 5, 2020
Merged

Conversation

cmcaine
Copy link
Contributor

@cmcaine cmcaine commented Oct 19, 2020

Why:

The wrong field is required in the workflow_dispatch event example.

The text says:

This example defines the name and home inputs and prints them using the github.event.inputs.name and github.event.inputs.home contexts. If a name isn't provided, the default value 'Mona the Octocat' is printed.

But name is required and location is not required and has no default.

What:

Make name optional and location required.

Check off the following:

I have not done any of these, this is a trivial change and your CI should catch issues :)

@welcome
Copy link

welcome bot commented Oct 19, 2020

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@janiceilene
Copy link
Contributor

Thanks so much for opening a PR @cmcaine! I'll get this triaged for review 🌟

@janiceilene janiceilene added actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team ecosystem This issue or pull request should be reviewed by the Docs Ecosystem team labels Oct 20, 2020
@janiceilene janiceilene added the hacktoberfest-accepted We might not merge this PR before Nov 1st, but it's a wonderful Hacktoberfest contribution! label Oct 27, 2020
@lucascosti lucascosti self-assigned this Nov 4, 2020
@lucascosti
Copy link
Contributor

👋 @cmcaine Thanks a lot for this PR!

You are correct that the description doesn't really match the example. However, I think we can change it so that the behavior is clearer, rather than switching the required values for the fields. I'll submit a new commit to your PR so it hopefully makes more sense!

@lucascosti
Copy link
Contributor

Ok, change made in 6bfe64d

You can see a preview here: https://docs-650--patch-1.herokuapp.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#example-workflow-configuration

@cmcaine: Let me know if this makes sense for you as well, and I'll merge it in 🙂

@cmcaine
Copy link
Contributor Author

cmcaine commented Nov 4, 2020

That looks like an improvement :)

but line 114 setting the default name should maybe be removed if a name is required? Or maybe default & required is fine?

@lucascosti
Copy link
Contributor

That looks like an improvement :)

but line 114 setting the default name should maybe be removed if a name is required? Or maybe default & required is fine?

Yep, default & required is fine 🙂. For the UI, this results in the field being pre-populated with the default value. e.g.:

image

I'll get this merged in!

@lucascosti lucascosti merged commit bf20462 into github:main Nov 5, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2020

Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours.

@cmcaine
Copy link
Contributor Author

cmcaine commented Nov 17, 2020

But what is the difference between default and default + required?

In both cases it is impossible to submit an empty string, because it will be replaced by the default, right? So what does required add?

On a field without a default, required does something more interesting.

@lucascosti
Copy link
Contributor

But what is the difference between default and default + required?

In both cases it is impossible to submit an empty string, because it will be replaced by the default, right? So what does required add?

On a field without a default, required does something more interesting.

  • default only: Prepopulates the UI with the default value. You can submit an empty string in the UI, but if you do, the empty value will be replaced with the default value in the workflow run execution.
  • default + required: Prepopulates the UI with the default value. You can't submit empty string in the UI; something must be provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team ecosystem This issue or pull request should be reviewed by the Docs Ecosystem team hacktoberfest-accepted We might not merge this PR before Nov 1st, but it's a wonderful Hacktoberfest contribution!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants