-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ref_name in actions sometimes blank for scheduled jobs #27678
Comments
That's a known issue. |
Oh ok. I swear I looked around in the issues, but didn't see it reported already. |
link #26815 |
I guess I must not have looked at closed issues. My main issue isn't that it doesn't show up in the UI, it's that I need the value in my actual action and it's not setting the variables. So far the only way I've found to "resolve" this is to try removing and recreating all my existing repos which isn't something I'm really excited about trying to do. |
So after more experimentation, repo I created as a minimal testcase still hasn't encountered the issue, but other new brand new repos do have this issue. It's nice in some ways because it is a reliable way for me to differentiate push and schedule events in my workflows in light of #27667, but it's all the more vexing to me why it would impact every single one of my repos... except the minimal example. I'll keep playing around and see if maybe something about the workflow size or complexity is actually the cause. |
I have the issue too, and I think I now found out when it happens. Basically, when a repo action like update issue label is being executed, the notify method gitea/services/actions/notifier_helper.go Line 111 in 4d1277c
is being triggered, which updates all the scheduled runs. But some actions like assignment of a label to an issue don't have a ref_name because they belong to the whole repo. For normal workflow triggers, the ref falls back to the default branch gitea/services/actions/notifier_helper.go Line 141 in 4d1277c
which is then also passed to the handleWorkflows method gitea/services/actions/notifier_helper.go Line 202 in 4d1277c
but not to the handleSchedules method gitea/services/actions/notifier_helper.go Line 198 in 4d1277c
So the simple fix should be also to pass the ref parameter to the handleSchedules method to use as action schedule ref. PR incoming :) |
Fix #27678 Please see #27678 (comment) for details.
Fix go-gitea#27678 Please see go-gitea#27678 (comment) for details.
Backport #28640 by @denyskon Fix #27678 Please see #27678 (comment) for details. Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Fix go-gitea#27678 Please see go-gitea#27678 (comment) for details.
Fix go-gitea#27678 Please see go-gitea#27678 (comment) for details.
Description
When my actions jobs are running, both ${{ gitea.ref_name }} and ${GITHUB_REF##*/} are empty for some repositories when running from the cron schedule (but work fine during push trigger). When I tried to make a new repo with a minimal test, I was unable to reproduce this issue but it is consistently the case for my existing repos. I slowly built up that minimal example until it was essentially the same as my existing job and it still returned the correct result. I've ran this instance for a while and so those existing repos were created in earlier gitea versions and that's the only thing I can think of that would make them different than a new repo. Any idea on what could cause this behavior and if there is something specific I need to look for and correct in the database maybe for those repos migrated from earlier versions?
Gitea Version
1.21.0-rc1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.40
Operating System
alpine:latest
How are you running Gitea?
self-built in a docker container
Database
SQLite
The text was updated successfully, but these errors were encountered: