Github.event.repository.fork context does detect forks in scheduled jobs

For my deploy steps on GitHub Actions workflows, I often include the following in the if condition field:

!github.event.repository.fork

The goal is to disable the step from running on forked repos that won’t have deploy permissions anyways. This has worked well for push events. However, I noticed in a recent scheduled CI build, the step with this condition was not skipped and a doomed deployment was attempted.

I am guessing the github.event context is different for scheduled builds in some way that caused the check to evaluate as true. Is this a bug? Is there a solution?

In this commit, I hardcoded the upstream repo name like github.repository == 'manubot/catalog'. But I like the elegance of workflow code that can be ported without modification between different repositories.

1 Like

From memory, the schedule event has virtually nothing in it. Dump the json to confirm.