Describe the bug
I found a documentation bug when I edited one of my GitHub Action configuration files.
At the end of the documentation, we could see the Running steps or jobs conditionally section, which told that we can specify a condition in the if: property based on the event name.

However, when I used if: github.event == 'push' to do such thing, the action didn't run this step.
To Reproduce
Steps to reproduce the behavior:
- Go to one of the action configuration files.
- Run a step with
if: github.event == 'push'.
- When push, this step doesn't run.
Expected behavior
Run a specific step when push events happen.
Runner Version and Platform
The latest version.
Ubuntu-latest (No matter what OS actually)
What's not working?
I tried to solve it by referring to the documentation Contexts and expression syntax for GitHub, in which I found that github.event was an object and github.event_name was a string.
So I tested them using codes like these.

- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

By dumping the github context, we can see that github.event is actually an object and github.event_name is a string that we want.
Finally, I change the code from github.event to github.event_name, and that step works successfully.
Solution
Update the document on the right of the online editor.
if: github.event == 'push' should be if: github.event_name == 'push'.
Thank you!
Describe the bug
I found a documentation bug when I edited one of my GitHub Action configuration files.
At the end of the documentation, we could see the
Running steps or jobs conditionallysection, which told that we can specify a condition in theif:property based on the event name.However, when I used
if: github.event == 'push'to do such thing, the action didn't run this step.To Reproduce
Steps to reproduce the behavior:
if: github.event == 'push'.Expected behavior
Run a specific step when
pushevents happen.Runner Version and Platform
The latest version.
Ubuntu-latest (No matter what OS actually)
What's not working?
I tried to solve it by referring to the documentation Contexts and expression syntax for GitHub, in which I found that
github.eventwas anobjectandgithub.event_namewas astring.So I tested them using codes like these.
By dumping the
githubcontext, we can see thatgithub.eventis actually an object andgithub.event_nameis a string that we want.Finally, I change the code from
github.eventtogithub.event_name, and that step works successfully.Solution
Update the document on the right of the online editor.
if: github.event == 'push'should beif: github.event_name == 'push'.Thank you!