Skip to content

Github context is not properly referenced within the JSON payload template #84

@ylkhayat

Description

@ylkhayat

Description

Github context is not properly referenced when using the workflow_run

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Create a workflow_run github action

Reproducible in:

package version: v1.18.0
node version: v16.13.0
OS version(s):

Steps to reproduce:

  1. create a Github Action running on the workflow_run events
  2. add a json template that uses ${{github.event.workflow_run.name}} for example
  3. fire the event, and the json template will not properly replace the github context

Example of my JSON template

{
  "text": "[Codebase News] - Pipeline is 🔴",
  "attachments": [
    {
      "color": "#000",
      "blocks": [
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": "Pipeline is 🔴 on `master`."
          }
        },
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": "Workflow `${{github.event.workflow_run.name}}` requires extra attention. :warning:"
          }
        },
        {
          "type": "context",
          "elements": [
            {
              "type": "mrkdwn",
              "text": "More info here ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.github.event.workflow_run.run_id}}"
            }
          ]
        }
      ]
    }
  ]
}

Expected result:

I would expect for the JSON file to have in hand the entire provided github context corresponding to the workflow_run event triggers.

Actual result:

As you can see ${{github.event.workflow_run.name}} did not work as expected
image
Also the regular github context did not work as well, here
image

Side Node:

I looked into this issue #51, and was aware that the problem got fixed, but I tested it multiple times, it was not properly fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions