-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gitea Action didn't use last commit when action is triggered by schdule #32219
Comments
I can not reproduce it immediately, but I can see the same issue in Gitea.com like https://gitea.com/gitea/docs
|
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. |
in my case the action checkout the 2rd commit in main branch. |
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. |
Does your workflow push any commits to the main branch? |
That is different problem. That is because there is an action's repository disappeared from Github. |
The reason why the run #276 does not use gitea/services/actions/notifier_helper.go Line 177 in cb739f5
|
yes |
In my case, the workflow pushed the commit to the main branch directly without any merge or PR. |
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. gitea/services/actions/notifier_helper.go Lines 118 to 125 in 900ac62
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
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. |
…o-gitea#32246) Fix go-gitea#32219 --------- Co-authored-by: delvh <dev.lh@web.de>
…o-gitea#32246) Fix go-gitea#32219 --------- Co-authored-by: delvh <dev.lh@web.de> (cherry picked from commit 81aec6d)
Description
I set up a workflow to exec routine action every day but the action uses outdated commit when checkout the code.
![image](https://private-user-images.githubusercontent.com/14054604/374689024-0ce9915b-5d80-4ec5-ab67-8e7ba275f49d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk2MzIsIm5iZiI6MTczOTI1OTMzMiwicGF0aCI6Ii8xNDA1NDYwNC8zNzQ2ODkwMjQtMGNlOTkxNWItNWQ4MC00ZWM1LWFiNjctOGU3YmEyNzVmNDlkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3MzUzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVkMDA0NWU1ZjJmZGFmY2M2Mzc0MGE2NGUzYTg3NmU4MzQ3MWZjZmYwNzE1YTU1NDdlYjU1NjUwNWYxMzFmNDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.T97UfPLovFylJeotjNB-gMz-oq6256x4vcSz7Ivrrnw)
![image](https://private-user-images.githubusercontent.com/14054604/374689255-7fe7e172-fb98-4882-8649-7db1c75c5168.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk2MzIsIm5iZiI6MTczOTI1OTMzMiwicGF0aCI6Ii8xNDA1NDYwNC8zNzQ2ODkyNTUtN2ZlN2UxNzItZmI5OC00ODgyLTg2NDktN2RiMWM3NWM1MTY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3MzUzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2MWM1ZDFkNWIyMzlhODcxOWYzYzUwNDkwM2Y0NmVhNmYzMDUwMTY2MTg0ZWYxZGQ5Mjk2MWIwYzI5NGI5YzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.a8Z2wlRSYOTWXQZo3Oq5YDRMqDzQvsKk8rk7rZ6pAkc)
![image](https://private-user-images.githubusercontent.com/14054604/374689408-a74672f2-c875-4ef6-b878-ca97ffa9f34a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk2MzIsIm5iZiI6MTczOTI1OTMzMiwicGF0aCI6Ii8xNDA1NDYwNC8zNzQ2ODk0MDgtYTc0NjcyZjItYzg3NS00ZWY2LWI4NzgtY2E5N2ZmYTlmMzRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3MzUzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI3YWY3MmUyNDJmYjM2ZjgyNDYzMmVjN2MyODM4NWIyNTRlMmY1ODE5YmE2ZWYxNjg4MTg3OTc1YTBiM2MxMjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9tAciTezLIEUvpJFoZtBnSeRQvxqa5_BSmJuHvcxYKM)
It seems that the action checkout the 2rd commit during running.
here is part of my workflow
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
The text was updated successfully, but these errors were encountered: