Gitea Actions Print gitea.actor Value Which Are Different from GitHub Action in Special Circumstances #13890

Closed
opened 2025-11-02 10:56:16 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @dangjinghao on GitHub (Dec 28, 2024).

Description

when a cron workflow is triggered, the {{ gitea.actor }} whould be replaced with gitea-actions but github action would print the username who set the trigger.

Gitea Version

1.22.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

gitea
github

Git Version

No response

Operating System

No response

How are you running Gitea?

workflow configuration

name: cron
on:
  schedule:
    - cron: "*/2 * * * *"
env:
  TZ: Asia/Shanghai

jobs:
  echo:
    runs-on: ubuntu-latest
    steps:
    - name: test
      run: |
        echo ${{ github.actor }}        

gitea:1.22.6, running in docker container, image: gitea/gitea:latest
gitea-runner version: v0.2.11, running in docker container, image: gitea/act_runner:latest

Database

None

Originally created by @dangjinghao on GitHub (Dec 28, 2024). ### Description when a cron workflow is triggered, the `{{ gitea.actor }}` whould be replaced with `gitea-actions` but github action would print the username who set the trigger. ### Gitea Version 1.22.6 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![gitea](https://github.com/user-attachments/assets/86a030ff-1e92-4684-a1aa-99e8e2341461) ![github](https://github.com/user-attachments/assets/20372ad2-c192-4bbd-bed8-d9c5a1dfb4e6) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? workflow configuration ```yaml name: cron on: schedule: - cron: "*/2 * * * *" env: TZ: Asia/Shanghai jobs: echo: runs-on: ubuntu-latest steps: - name: test run: | echo ${{ github.actor }} ``` gitea:1.22.6, running in docker container, `image: gitea/gitea:latest` gitea-runner version: v0.2.11, running in docker container, `image: gitea/act_runner:latest` ### Database None
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 10:56:16 -06:00
Author
Owner

@Zettat123 commented on GitHub (Dec 31, 2024):

In fact, this is by design. The reason is that in some cases Gitea cannot get the actor when creating schedule tasks (see #30581).

I checked the GitHub documentation and found that GitHub may require users to alter the cron to reactivate the scheduled workflow. Indeed, the actor can always be recorded in this way. But I'm not sure if we should do this as it requires users to do more operations to activate/reactivate the workflow.

@Zettat123 commented on GitHub (Dec 31, 2024): In fact, this is by design. The reason is that in some cases Gitea cannot get the actor when creating schedule tasks (see #30581). I checked the [GitHub documentation](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule) and found that GitHub may require users to alter the cron to reactivate the scheduled workflow. Indeed, the actor can always be recorded in this way. But I'm not sure if we should do this as it requires users to do more operations to activate/reactivate the workflow.
Author
Owner

@dangjinghao commented on GitHub (Feb 18, 2025):

Thank you for your explanation. Now I'm using {{ gitea.repository_owner }} as a solution to represent owner's username. Just keep things as they are.

@dangjinghao commented on GitHub (Feb 18, 2025): Thank you for your explanation. Now I'm using `{{ gitea.repository_owner }}` as a solution to represent owner's username. Just keep things as they are.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13890