Gitea Action didn't use last commit when action is triggered by schdule #13576

Closed
opened 2025-11-02 10:46:33 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @ChaojuWang on GitHub (Oct 8, 2024).

Description

I set up a workflow to exec routine action every day but the action uses outdated commit when checkout the code.
image
image
image
It seems that the action checkout the 2rd commit during running.

here is part of my workflow

name: XXX

on:
  schedule: # execute every 24 hours
    - cron: "35 6 * * *"
...
 steps:
    - name: XXX
      uses: actions/checkout@v4
      with:
        path: xxx
...

Gitea Version

1.22.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.45.2

Operating System

Docker 27.0.3 in Ubuntu 22.04.4 LTS

How are you running Gitea?

Docker 27.0.3 in Ubuntu 22.04.4 LTS
start both Gitea and runner by docker-compose

Database

SQLite

Originally created by @ChaojuWang on GitHub (Oct 8, 2024). ### Description I set up a workflow to exec routine action every day but the action uses outdated commit when checkout the code. ![image](https://github.com/user-attachments/assets/0ce9915b-5d80-4ec5-ab67-8e7ba275f49d) ![image](https://github.com/user-attachments/assets/7fe7e172-fb98-4882-8649-7db1c75c5168) ![image](https://github.com/user-attachments/assets/a74672f2-c875-4ef6-b878-ca97ffa9f34a) It seems that the action checkout the 2rd commit during running. here is part of my workflow ``` name: XXX on: schedule: # execute every 24 hours - cron: "35 6 * * *" ... steps: - name: XXX uses: actions/checkout@v4 with: path: xxx ... ``` ### Gitea Version 1.22.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.45.2 ### Operating System Docker 27.0.3 in Ubuntu 22.04.4 LTS ### How are you running Gitea? Docker 27.0.3 in Ubuntu 22.04.4 LTS start both Gitea and runner by docker-compose ### Database SQLite
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 10:46:33 -06:00
Author
Owner

@yp05327 commented on GitHub (Oct 10, 2024):

I can not reproduce it immediately, but I can see the same issue in Gitea.com like https://gitea.com/gitea/docs

image
adminxxxx is pushed at 10/9 PM 9:00
image
more changes and upgrade to 1.22.3 is pushed at 10/9 PM 3:03
So the title of the schedule should be more changes?

image
These there commits all failed during set up job. Maybe it is related.

@yp05327 commented on GitHub (Oct 10, 2024): I can not reproduce it immediately, but I can see the same issue in Gitea.com like https://gitea.com/gitea/docs ![image](https://github.com/user-attachments/assets/9527fc21-497e-4860-95d3-e615f41accc0) adminxxxx is pushed at 10/9 PM 9:00 ![image](https://github.com/user-attachments/assets/a4ae7c17-8697-4351-a1a9-6c44c2ef0b2e) more changes and upgrade to 1.22.3 is pushed at 10/9 PM 3:03 So the title of the schedule should be `more changes`? ![image](https://github.com/user-attachments/assets/b1ea6f4c-3779-4aae-a7b0-4141e89177ef) These there commits all failed during set up job. Maybe it is related.
Author
Owner

@Zettat123 commented on GitHub (Oct 10, 2024):

I don't know the cause of this issue. But to fix it, you can disable "Actions" and then enable it in the repo's settings page. This operation will make Gitea re-detect scheduled workflows, which should be able to make the workflow use the latest commit.

@Zettat123 commented on GitHub (Oct 10, 2024): I don't know the cause of this issue. But to fix it, you can disable "Actions" and then enable it in the repo's settings page. This operation will make Gitea re-detect scheduled workflows, which should be able to make the workflow use the latest commit.
Author
Owner

@ChaojuWang commented on GitHub (Oct 10, 2024):

in my case the action checkout the 2rd commit in main branch.
maybe the gitea pass the wrong ref info to the runner?
image
According to the doc, it seems that the checkout action use $GITHUB_SHA as default commit.

@ChaojuWang commented on GitHub (Oct 10, 2024): in my case the action checkout the 2rd commit in main branch. maybe the gitea pass the wrong ref info to the runner? ![image](https://github.com/user-attachments/assets/d5cffcc6-2284-497a-b5f8-4b08c3b5db4c) According to the [doc](https://github.com/actions/checkout), it seems that the checkout action use `$GITHUB_SHA` as default commit.
Author
Owner

@ChaojuWang commented on GitHub (Oct 10, 2024):

I don't know the cause of this issue. But to fix it, you can disable "Actions" and then enable it in the repo's settings page. This operation will make Gitea re-detect scheduled workflows, which should be able to make the workflow use the latest commit.

I've closed and reopened the flow. It should be run on next scheduled time.

Hope that the 1.23 can be released soon, so we can manually active the flow.

@ChaojuWang commented on GitHub (Oct 10, 2024): > I don't know the cause of this issue. But to fix it, you can disable "Actions" and then enable it in the repo's settings page. This operation will make Gitea re-detect scheduled workflows, which should be able to make the workflow use the latest commit. I've closed and reopened the flow. It should be run on next scheduled time. Hope that the 1.23 can be released soon, so we can manually active the flow.
Author
Owner

@Zettat123 commented on GitHub (Oct 10, 2024):

I've closed and reopened the flow. It should be run on next scheduled time.

I'm not sure what you mean by "closed and reopened the flow". To make Gitea re-detect schedule workflows, you need to go to the setting page of this repo, then disable and enable the "Actions". I hope this would help.

image

@Zettat123 commented on GitHub (Oct 10, 2024): > I've closed and reopened the flow. It should be run on next scheduled time. I'm not sure what you mean by "closed and reopened the flow". To make Gitea re-detect schedule workflows, you need to go to the setting page of this repo, then disable and enable the "Actions". I hope this would help. ![image](https://github.com/user-attachments/assets/edef7b31-e9a4-4e52-8cdd-a4da0c3e9d52)
Author
Owner

@ChaojuWang commented on GitHub (Oct 10, 2024):

I'm not sure what you mean by "closed and reopened the flow". To make Gitea re-detect schedule workflows, you need to go to the setting page of this repo, then disable and enable the "Actions". I hope this would help.

Thanks
I tried to close and reopen the workflow before.
image

@ChaojuWang commented on GitHub (Oct 10, 2024): > I'm not sure what you mean by "closed and reopened the flow". To make Gitea re-detect schedule workflows, you need to go to the setting page of this repo, then disable and enable the "Actions". I hope this would help. Thanks I tried to close and reopen the workflow before. ![image](https://github.com/user-attachments/assets/bc72f6ad-57a5-4cdf-a46d-ef0cc947dc24)
Author
Owner

@ChaojuWang commented on GitHub (Oct 11, 2024):

I've closed and reopened the flow. It should be run on next scheduled time.

I'm not sure what you mean by "closed and reopened the flow". To make Gitea re-detect schedule workflows, you need to go to the setting page of this repo, then disable and enable the "Actions". I hope this would help.

image

The first workflow works fine at Oct 10, 2024, 11:36.
image
The first workflow pushed a commit.

But the second workflow used the old commit again while running.
image

image

@ChaojuWang commented on GitHub (Oct 11, 2024): > > I've closed and reopened the flow. It should be run on next scheduled time. > > I'm not sure what you mean by "closed and reopened the flow". To make Gitea re-detect schedule workflows, you need to go to the setting page of this repo, then disable and enable the "Actions". I hope this would help. > > ![image](https://private-user-images.githubusercontent.com/15528715/375329049-edef7b31-e9a4-4e52-8cdd-a4da0c3e9d52.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTMwMjIsIm5iZiI6MTcyODYxMjcyMiwicGF0aCI6Ii8xNTUyODcxNS8zNzUzMjkwNDktZWRlZjdiMzEtZTlhNC00ZTUyLThjZGQtYTRkYTBjM2U5ZDUyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAyMTIwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0Y2ZkZTViYTNiZjI2NzgyYTFjOWJiYjY2YmUyMzEwZGQwNDE2NGI4MDU3Yjk4MDZiOTliNDk4ZDM5MDAzYTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.U7rq85igTYIZp_b1YnYEB6qdDwd1OcSrdCrZkhqvw6o) The first workflow works fine at Oct 10, 2024, 11:36. ![image](https://github.com/user-attachments/assets/08fa5897-eb75-4579-a31f-d5d59ac497a3) The first workflow pushed a commit. But the second workflow used the old commit again while running. ![image](https://github.com/user-attachments/assets/96f57dd7-dc11-4062-bd13-009b0c689c83) ![image](https://github.com/user-attachments/assets/b0e2be57-9357-4694-9dd1-c6cf0b75ecbf)
Author
Owner

@Zettat123 commented on GitHub (Oct 11, 2024):

Does your workflow push any commits to the main branch?

@Zettat123 commented on GitHub (Oct 11, 2024): Does your workflow push any commits to the main branch?
Author
Owner

@lunny commented on GitHub (Oct 11, 2024):

I can not reproduce it immediately, but I can see the same issue in Gitea.com like gitea.com/gitea/docs

image adminxxxx is pushed at 10/9 PM 9:00 image more changes and upgrade to 1.22.3 is pushed at 10/9 PM 3:03 So the title of the schedule should be more changes?

image These there commits all failed during set up job. Maybe it is related.

That is different problem. That is because there is an action's repository disappeared from Github.

@lunny commented on GitHub (Oct 11, 2024): > I can not reproduce it immediately, but I can see the same issue in Gitea.com like [gitea.com/gitea/docs](https://gitea.com/gitea/docs) > > ![image](https://private-user-images.githubusercontent.com/18380374/375287776-9527fc21-497e-4860-95d3-e615f41accc0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTYxNTcsIm5iZiI6MTcyODYxNTg1NywicGF0aCI6Ii8xODM4MDM3NC8zNzUyODc3NzYtOTUyN2ZjMjEtNDk3ZS00ODYwLTk1ZDMtZTYxNWY0MWFjY2MwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAzMDQxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIyZDhkMTY2NjMwYWJlYWFiODk0MjRmZjI3NWQzMjcxY2NiMzU3NGU5ZTFhMzRlYjUyMDU1YzlhMDFhOTEyODkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.U4yJoWZV1H-2jCZV0tN8BgYrZUEZ0qbH-NRgjqPhj2g) adminxxxx is pushed at 10/9 PM 9:00 ![image](https://private-user-images.githubusercontent.com/18380374/375288004-a4ae7c17-8697-4351-a1a9-6c44c2ef0b2e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTYxNTcsIm5iZiI6MTcyODYxNTg1NywicGF0aCI6Ii8xODM4MDM3NC8zNzUyODgwMDQtYTRhZTdjMTctODY5Ny00MzUxLWExYTktNmM0NGMyZWYwYjJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAzMDQxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFiYTQ0NWI4YzJmNTQ5NDE4NjQ4NmIxODI4ZGQ1NjgwYmIxNDZiZTcxYWQ1MGFmNzMzY2YwMmQ4MjNkZmE0OTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ukO0okEWlhRNJN_n7QXJiql2EYAWHLN6RjGiIdmD9cQ) more changes and upgrade to 1.22.3 is pushed at 10/9 PM 3:03 So the title of the schedule should be `more changes`? > > ![image](https://private-user-images.githubusercontent.com/18380374/375289347-b1ea6f4c-3779-4aae-a7b0-4141e89177ef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTYxNTcsIm5iZiI6MTcyODYxNTg1NywicGF0aCI6Ii8xODM4MDM3NC8zNzUyODkzNDctYjFlYTZmNGMtMzc3OS00YWFlLWE3YjAtNDE0MWU4OTE3N2VmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAzMDQxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVmZTdkNTg2NTVkOWVlOTZhYjY5NTdmZGNhZDg0ZTU0NzFlYjYyMGUzOTJmZTY1N2E1ZjgzZTVjYzM4ZDU3MjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.uEkqt4K33tgeI6dTvDBdmkTEc8wdV3GNMf0o6NVBNEo) These there commits all failed during set up job. Maybe it is related. That is different problem. That is because there is an action's repository disappeared from Github.
Author
Owner

@Zettat123 commented on GitHub (Oct 11, 2024):

I can not reproduce it immediately, but I can see the same issue in Gitea.com like https://gitea.com/gitea/docs

image adminxxxx is pushed at 10/9 PM 9:00 image more changes and upgrade to 1.22.3 is pushed at 10/9 PM 3:03 So the title of the schedule should be more changes?

image These there commits all failed during set up job. Maybe it is related.

The reason why the run #276 does not use d2ff4a6117 is that d2ff4a6117 was pushed to another branch (not the main branch, see PR). And I guess this PR used "Fast-forward" merge style so no merge commit was created and nothing was pushed to the main branch when this PR was merged. As a result, Gitea did not re-detect the schedule workflow and the schedule task was not updated.

cb739f5333/services/actions/notifier_helper.go (L177)

@Zettat123 commented on GitHub (Oct 11, 2024): > I can not reproduce it immediately, but I can see the same issue in Gitea.com like https://gitea.com/gitea/docs > > ![image](https://private-user-images.githubusercontent.com/18380374/375287776-9527fc21-497e-4860-95d3-e615f41accc0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTUyMTAsIm5iZiI6MTcyODYxNDkxMCwicGF0aCI6Ii8xODM4MDM3NC8zNzUyODc3NzYtOTUyN2ZjMjEtNDk3ZS00ODYwLTk1ZDMtZTYxNWY0MWFjY2MwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAyNDgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY5Mzc5NDM1ODU4MTEzY2Q1M2U3ODlhYzk5OTY0ODAxYmMwMTk4MDlhYmIwZDc3Y2Y0NWFkZDg0M2QxMjM0ZTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.s4I_iFbCQrrQcy_1I3hr_JeHmCxHQeRLDtBXkVk_MwY) adminxxxx is pushed at 10/9 PM 9:00 ![image](https://private-user-images.githubusercontent.com/18380374/375288004-a4ae7c17-8697-4351-a1a9-6c44c2ef0b2e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTUyMTAsIm5iZiI6MTcyODYxNDkxMCwicGF0aCI6Ii8xODM4MDM3NC8zNzUyODgwMDQtYTRhZTdjMTctODY5Ny00MzUxLWExYTktNmM0NGMyZWYwYjJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAyNDgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmZmE5YWYwOGY5Nzk1N2JkODdjOTE1YTNhMmFhMjQ0ZWU3Nzk1YmQxOGM3M2ZkZDYxNGY5ZTc1MWEwYTEwYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.119w6jsr3X64D7q8PNotONRg3hd0hPfEZ75V3xZKueY) more changes and upgrade to 1.22.3 is pushed at 10/9 PM 3:03 So the title of the schedule should be `more changes`? > > ![image](https://private-user-images.githubusercontent.com/18380374/375289347-b1ea6f4c-3779-4aae-a7b0-4141e89177ef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTUyMTAsIm5iZiI6MTcyODYxNDkxMCwicGF0aCI6Ii8xODM4MDM3NC8zNzUyODkzNDctYjFlYTZmNGMtMzc3OS00YWFlLWE3YjAtNDE0MWU4OTE3N2VmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAyNDgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhMDE1MzJjMTBkNzgwNWIyYTczZTMzM2QxYjUyYzEyY2M4ZGYyNDk5NDJjMTRkYjA1MGZlODQ1ZDI3NTFkZWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hCyh6lm47kiL6ZWzC94ebLYWalFt-hDkzwGp3Oc7tiQ) These there commits all failed during set up job. Maybe it is related. The reason why the run #276 does not use `d2ff4a6117` is that `d2ff4a6117` was pushed to another branch (not the main branch, see [PR](https://gitea.com/gitea/docs/pulls/79)). And I guess this PR used "Fast-forward" merge style so no merge commit was created and nothing was pushed to the main branch when this PR was merged. As a result, Gitea did not re-detect the schedule workflow and the schedule task was not updated. https://github.com/go-gitea/gitea/blob/cb739f533358a8cf6e1b6875b3d4f0da3bfa7c95/services/actions/notifier_helper.go#L177
Author
Owner

@ChaojuWang commented on GitHub (Oct 11, 2024):

Does your workflow push any commits to the main branch?

yes

@ChaojuWang commented on GitHub (Oct 11, 2024): > Does your workflow push any commits to the main branch? yes
Author
Owner

@ChaojuWang commented on GitHub (Oct 11, 2024):

I can not reproduce it immediately, but I can see the same issue in Gitea.com like https://gitea.com/gitea/docs
image adminxxxx is pushed at 10/9 PM 9:00 image more changes and upgrade to 1.22.3 is pushed at 10/9 PM 3:03 So the title of the schedule should be more changes?
image These there commits all failed during set up job. Maybe it is related.

The reason why the run #276 does not use d2ff4a6117 is that d2ff4a6117 was pushed to another branch (not the main branch, see PR). And I guess this PR used "Fast-forward" merge style so no merge commit was created and nothing was pushed to the main branch when this PR was merged. As a result, Gitea did not re-detect the schedule workflow and the schedule task was not updated.

cb739f5333/services/actions/notifier_helper.go (L177)

In my case, the workflow pushed the commit to the main branch directly without any merge or PR.
And there is a huge time gap between two workflows so they won't be executed together.

@ChaojuWang commented on GitHub (Oct 11, 2024): > > I can not reproduce it immediately, but I can see the same issue in Gitea.com like https://gitea.com/gitea/docs > > ![image](https://private-user-images.githubusercontent.com/18380374/375287776-9527fc21-497e-4860-95d3-e615f41accc0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTUyMTAsIm5iZiI6MTcyODYxNDkxMCwicGF0aCI6Ii8xODM4MDM3NC8zNzUyODc3NzYtOTUyN2ZjMjEtNDk3ZS00ODYwLTk1ZDMtZTYxNWY0MWFjY2MwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAyNDgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY5Mzc5NDM1ODU4MTEzY2Q1M2U3ODlhYzk5OTY0ODAxYmMwMTk4MDlhYmIwZDc3Y2Y0NWFkZDg0M2QxMjM0ZTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.s4I_iFbCQrrQcy_1I3hr_JeHmCxHQeRLDtBXkVk_MwY) adminxxxx is pushed at 10/9 PM 9:00 ![image](https://private-user-images.githubusercontent.com/18380374/375288004-a4ae7c17-8697-4351-a1a9-6c44c2ef0b2e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTUyMTAsIm5iZiI6MTcyODYxNDkxMCwicGF0aCI6Ii8xODM4MDM3NC8zNzUyODgwMDQtYTRhZTdjMTctODY5Ny00MzUxLWExYTktNmM0NGMyZWYwYjJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAyNDgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmZmE5YWYwOGY5Nzk1N2JkODdjOTE1YTNhMmFhMjQ0ZWU3Nzk1YmQxOGM3M2ZkZDYxNGY5ZTc1MWEwYTEwYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.119w6jsr3X64D7q8PNotONRg3hd0hPfEZ75V3xZKueY) more changes and upgrade to 1.22.3 is pushed at 10/9 PM 3:03 So the title of the schedule should be `more changes`? > > ![image](https://private-user-images.githubusercontent.com/18380374/375289347-b1ea6f4c-3779-4aae-a7b0-4141e89177ef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg2MTUyMTAsIm5iZiI6MTcyODYxNDkxMCwicGF0aCI6Ii8xODM4MDM3NC8zNzUyODkzNDctYjFlYTZmNGMtMzc3OS00YWFlLWE3YjAtNDE0MWU4OTE3N2VmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDExVDAyNDgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhMDE1MzJjMTBkNzgwNWIyYTczZTMzM2QxYjUyYzEyY2M4ZGYyNDk5NDJjMTRkYjA1MGZlODQ1ZDI3NTFkZWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hCyh6lm47kiL6ZWzC94ebLYWalFt-hDkzwGp3Oc7tiQ) These there commits all failed during set up job. Maybe it is related. > > The reason why the run #276 does not use `d2ff4a6117` is that `d2ff4a6117` was pushed to another branch (not the main branch, see [PR](https://gitea.com/gitea/docs/pulls/79)). And I guess this PR used "Fast-forward" merge style so no merge commit was created and nothing was pushed to the main branch when this PR was merged. As a result, Gitea did not re-detect the schedule workflow and the schedule task was not updated. > > https://github.com/go-gitea/gitea/blob/cb739f533358a8cf6e1b6875b3d4f0da3bfa7c95/services/actions/notifier_helper.go#L177 In my case, the workflow pushed the commit to the main branch directly without any merge or PR. And there is a huge time gap between two workflows so they won't be executed together.
Author
Owner

@Zettat123 commented on GitHub (Oct 12, 2024):

Now I know the cause of this issue. To avoid loop triggering, changes pushed by actions won't trigger workflow detection. This is by design.

900ac62251/services/actions/notifier_helper.go (L118-L125)

To resolve this issue, you can create a new token that includes write permission to the repo. And use this token in your workflow like

      - uses: actions/checkout@v4
        with:
          token: ${{ secrets.YOUR_TOKEN }}

Then the changes pushed to the repo will be able to trigger workflow detection so that the schedule tasks will use the latest ref.


And I'm also thinking that we should allow Gitea to re-detect schedule tasks even if the doer is "ActionsUser". I did some testing on GitHub and found that changes pushed by the "ActionsUser" are also able to trigger updates to schedule tasks.

@Zettat123 commented on GitHub (Oct 12, 2024): Now I know the cause of this issue. To avoid loop triggering, changes pushed by actions won't trigger workflow detection. This is by design. https://github.com/go-gitea/gitea/blob/900ac622514081b90e08135cab175d5d1ea1bc9d/services/actions/notifier_helper.go#L118-L125 To resolve this issue, you can [create a new token](https://docs.gitea.com/next/development/api-usage#generating-and-listing-api-tokens) that includes write permission to the repo. And use this token in your workflow like ``` - uses: actions/checkout@v4 with: token: ${{ secrets.YOUR_TOKEN }} ``` Then the changes pushed to the repo will be able to trigger workflow detection so that the schedule tasks will use the latest ref. --- And I'm also thinking that we should allow Gitea to re-detect schedule tasks even if the doer is "ActionsUser". I did some testing on GitHub and found that changes pushed by the "ActionsUser" are also able to trigger updates to schedule tasks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13576