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

workflow_call's github context event_name ambiguity #16515

Closed
1 task done
Skenvy opened this issue Mar 24, 2022 · 8 comments
Closed
1 task done

workflow_call's github context event_name ambiguity #16515

Skenvy opened this issue Mar 24, 2022 · 8 comments
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 needs SME This proposal needs review from a subject matter expert SME stale The request for an SME has staled waiting for review Issue/PR is waiting for a writer's review

Comments

@Skenvy
Copy link

Skenvy commented Mar 24, 2022

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_call

What part(s) of the article would you like to see updated?

The paragraph for the "workflow_call" event is somewhat ambiguous with the mixing terms of "webhook payload" and "event payload", and says;

the event payload in the called workflow is the same event payload from the calling workflow

But there is a distinction in naming between the "webhook" payload and the "event" payload across the rest of the docs. When reading this description, it implies that there would be a webhook payload associed with the workflow_call event, perhaps one mentioned on https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads (although there is none) that would simply have the same github.event payload as calling workflow, but that the other generic "webhook" payload fields would be equivalent to others.

For example, I assumed upon reading it that the github.event_name field, being not in the github.event payload, would equal workflow_call, and was surprised to discover that the event name was also the same as that of the "webhook payload" that initiated the callee workflow.

This description could be made more clear by saying that it adopts the "webhook" payload of the callee, rather than just the "event" payload.

Additional information

No response

@Skenvy Skenvy added the content This issue or pull request belongs to the Docs Content team label Mar 24, 2022
@welcome
Copy link

welcome bot commented Mar 24, 2022

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

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Mar 24, 2022
@ramyaparimi ramyaparimi added actions This issue or pull request should be reviewed by the docs actions team waiting for review Issue/PR is waiting for a writer's review needs SME This proposal needs review from a subject matter expert and removed triage Do not begin working on this issue until triaged by the team labels Mar 25, 2022
@ramyaparimi
Copy link
Contributor

@Skenvy
Thanks so much for opening an issue! This needs a technical review, I'll triage this for the team to review 👀

@github-actions
Copy link
Contributor

This is a gentle bump for the docs team that this issue is waiting for technical review.

@github-actions github-actions bot added the SME stale The request for an SME has staled label Apr 12, 2022
@Kieudung717

This comment was marked as spam.

@ramyaparimi
Copy link
Contributor

@Skenvy Thanks so much for your patience. I spoke with the team and we are not going to accept this contribution 💛. We really appreciate your time and interest in improving GitHub docs 💖 .

@Skenvy
Copy link
Author

Skenvy commented Apr 13, 2022

In other parts of the docs, the webhook payload's fields are synonymous with the github.* fields (and the webhook event payload is synonymous with the github.event field). The only place this distinction appears to be ambiguous is on the description of the workflow_call event. It asserts that the webhook event payload, not the entire webhook payload is the same as that of the callee (where it appears from dumping the contexts during the called action, that the entire webhook payload is the same). Either the description is not wholly unambiguous (not sure why an ambiguity would be ok anyway), or the implementation of the pass-through of the webhook payload | webhook event payload is wrong (which I assume is not the case). Alternatively the terms are mis-conflated between the events-that-trigger-workflows and webhook-events-and-payloads pages. Again, not sure why an ambiguity like that is accepted, wilfully so if it's assumed that the names for the payloads across both events-that-trigger-workflows and webhook-events-and-payloads pages are equivalent and correct.

@GMNGeoffrey
Copy link

I had exactly the same confusion and this issue appears to be the only documentation on this issue. Please reconsider clarifying what context values are in the case of workflow_call

ChadKillingsworth added a commit to google/closure-compiler-npm that referenced this issue Nov 8, 2022
While the trigger is listed as `workflow_call`, apparently the inherited event retains the original `workflow_dispatch` name. See github/docs#16515
@RobinHoutevelts
Copy link

I found this issue and a discussion at actions/runner#1884

I have a workflow test that's being dispatched from the ui.
It calls another workflow create-test-db.

When create-test-db is called from the test workflow, github.event_name is workflow_dispatch instead of workflow_call.
I assume this is because test was dispatched from the ui, but this is very confusing.

I followed the "solution" in the linked discussion.
My create-test-db workflow now has an extra input in the on.workflow_dispatch.inputs

name: create-test-db

on:
  workflow_call:
+    inputs:
+      is_workflow_call:
+        description: 'Ugh'
+        required: true
+        type: string
+        default: 'true'

  workflow_dispatch:

jobs:

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 needs SME This proposal needs review from a subject matter expert SME stale The request for an SME has staled waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

No branches or pull requests

6 participants
@GMNGeoffrey @RobinHoutevelts @Skenvy @ramyaparimi @Kieudung717 and others