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 github context is not updated. #1548

Closed
jhautin opened this issue Dec 10, 2021 · 1 comment
Closed

workflow_call github context is not updated. #1548

jhautin opened this issue Dec 10, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@jhautin
Copy link

jhautin commented Dec 10, 2021

Describe the bug

I use a main workflow that is calculating a value. this value is given as input of a sub workflow.

The issue is that the value is not part of the context. i have the original github context from the main workflow not the context with the new input.

Moreover, the event type is not a workflow_call but a workflow_dispatch.

main workflow : https://github.com/vectice/github-actions-issue/blob/main/.github/workflows/main_workflow.yml
sub workflow : https://github.com/vectice/github-actions-issue/blob/main/.github/workflows/sub_workflow.yml

To Reproduce
Steps to reproduce the behavior:

  1. Go to public repository https://github.com/vectice/github-actions-issue
  2. Run the main_workflow (https://github.com/vectice/github-actions-issue/actions/workflows/main_workflow.yml)
  3. See context in display_context job of the sub workflow. the context is not the good one.

Expected behavior
I would expect a github context with:

  • github event type set to workflow_call
  • github inputs set to values in the with keyword (ie github.event.inputs.something not empty)

Runner Version and Platform

Current runner version: 2.285.1

What's not working?

the context of the called sub-workflow contains the following values:

{
"workflow": "Main workflow",                                 <<< should be sub workflow
  "event_name": "workflow_dispatch",                    <<< should be workflow_call
  "event": {
    "inputs": {
      "call-sub-workflow": "true"                               <<< should be "something": "a_sample_value"
    }
  },
  "workflow": ".github/workflows/main_workflow.yml"    <<< should be .github/workflows/sub_workflow.yml

}

Job Log Output

If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.

Runner and Worker's Diagnostic Logs

If applicable, add relevant diagnostic log information. Logs are located in the runner's _diag folder. The runner logs are prefixed with Runner_ and the worker logs are prefixed with Worker_. Each job run correlates to a worker log. All sensitive information should already be masked out, but please double-check before pasting here.

@jhautin jhautin added the bug Something isn't working label Dec 10, 2021
@TingluoHuang
Copy link
Member

base on https://docs.github.com/en/actions/learn-github-actions/reusing-workflows

When a reusable workflow is triggered by a caller workflow, the github context is always associated with the caller workflow. The called workflow is automatically granted access to github.token and secrets.GITHUB_TOKEN. For more information about the github context, see "Context and expression syntax for GitHub Actions."

You can ask on https://github.community/c/code-to-cloud/github-actions/41 if you need more help.
The runner itself has no control over this part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants