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). |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 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’. |
Beta Was this translation helpful? Give feedback.
-
I think this answer is wrong. In my experience, it has nothing to do with who edited the |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
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’.