-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
/app/twine-upload.sh: line 45: GITHUB_WORKFLOW_REF: unbound variable #275
Comments
Hey, @WilliamStam! I see you're using a custom container. That was never really considered / tested / supported. It might've worked by accident. This might need some research and might be GitHub's bug. I see that it's used in a new feature that is designed to help users using long-living credentials migrate to tokenless publishing that uses short-lived tokens under the hood and does not require maintaining any secrets in the GH repo, nor tokens on the PyPI side. I recommend migrating to this method regardless of this issue. Said feature was implemented by @facutuesca in a series of PRs: #250 / #258 / #270. It was first released in v1.10.2: #264. So your workarounds are:
P.S. It's best to also link actual CI runs in a GH repo so that we could look into the logs deeper. Rerunning the job in debug mode is also known to reveal more context. |
@facutuesca would you be open to researching this and perhaps adding a smoke test job to our CI with a custom |
yeah i was taking a chance here since this action is "for github" and im working with gitea. pinning the version to 1.10.1 worked (again sorry i know this is out of scope since its not github) my initial thinking was if i simply set the variable to an empty string then at least it exists so shouldn't throw the error. but i couldn't get that right... my brain seems to still be on weekend mode |
@webknjaz The issue is due to using Gitea rather than GitHub to run the action. As @WilliamStam suggested, supporting the absence of GitHub-injected variables might be out of scope since this is a GH Action. WDYT? |
a simple solution would be to check if the variable exists and if so use it else ignore it or set a empty string to it if it doesn't exist since i think this is the only thing making it not compatible
|
@WilliamStam I think this might be a bug on Gitea's side, since they do seem to support Looking at their code, it looks like they do define Could you try printing |
I agree with @facutuesca's analysis here -- this looks pretty firmly like a bug in Gitea's emulation of GH actions. @webknjaz's recommendation to downgrade to v1.10.1 should fix the proximate bug here, but it wouldn't surprise me at all if Gitea's attempt to reproduce GH actions has other subtle bugs, given that there's no standard for it 🙂 |
Wow, I didn't even realize that running actions on another platform is a thing. Thanks for the context! Does it support annotations/job summaries? I'm worried that if we attempted to maintain support for all the possible environments, we'd drown in burden. @WilliamStam if you're not using GH, do you really need the action in the first place? Especially since you're unable to use tokenless publishing. It could be replaced with a |
I don't think it makes sense for us to maintain such corner cases. Especially, since it's a bug in third-party platforms where using the action might not even make sense. I also think that an additional workaround might be just setting that var to some dummy value thought |
using this action with gitea tho. everything was working great and then suddenly it stopped.
ive tried manually pushing to gitea's pypi repo and it works fine. but whenever i try publish using this action it errors out with
im including the full workflow action here. (it includes non relevant stuff sorry)
line 45 of twine-upload.sh
WORKFLOW_FILENAME="$(echo ${GITHUB_WORKFLOW_REF} | cut -d'/' -f5- | cut -d'@' -f1)"
which only gets used in the "else"
where does the issue lie here? my thinking is that gitea isnt setting the
GITHUB_WORKFLOW_REF
env in the action runner. but is it something that gitea should even be concerned with? shouldnt this action check if it exists and if so use it else ignore?(gitea 1.22.2)
The text was updated successfully, but these errors were encountered: