Who will be the GitHub actor when a workflow runs on a schedule? #25067
|
The documentation at https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context states that github.actor resolves to The login of the user that initiated the workflow run. Now, who would that be when the workflow runs on a schedule? I noticed in https://github.com/ergebnis/composer-normalize/runs/388922221 (a scheduled run) that the actor resolves to localheinz (that’s me). |
Replies: 4 comments 3 replies
|
The latest user who create the schedule trigger will be the actor for the schedule workflow. As mentioned, you can export ‘github.actor’ in context for check. For instance, if user A create the schedule trigger, workflow is triggered with actor ‘user A’, then user B modified the schedule setting, workflow is triggered with actor ‘user B’. |
|
I think this answer is wrong. In my experience, it has nothing to do with who edited the |
|
I asked GitHub support about this and got the following answer:
I had first tried to change the actor by merging a PR by the desired new user to the cron job .yml action. That did not change the actor. What did work was to log in as the new user and then disable and re-enable the workflow, as linked to above. |
|
This is very inconvenient when it comes to sending workflow run notifications to a specific user. Are there any plans for an explicit "actor" option for scheduled workflows? |



The latest user who create the schedule trigger will be the actor for the schedule workflow.
As mentioned, you can export ‘github.actor’ in context for check.
For instance, if user A create the schedule trigger, workflow is triggered with actor ‘user A’, then user B modified the schedule setting, workflow is triggered with actor ‘user B’.