Closed nicolas-brousse closed 10 months ago
Hi @nicolas-brousse thank you for this PR, I am all for enabling Gitea users, so this is a good change.
There's one edge case missing from your code: when someone specified a GitHub Token from an environment variable other than the default GitHub token, such as a secret. It's extremely unlikely, but could happen. Could you please modify your code to read from both the input and the environment variable and prefer the environment variable if set for compatibility?
Also, your commit is missing a DCO signoff. Could you please add that?
Great work, thank you for making this!
@janosdebugs happy that this feature is something you're for.
I've just updated my commit to add DCO signoff.
There's one edge case missing from your code: when someone specified a GitHub Token from an environment variable other than the default GitHub token, such as a secret. It's extremely unlikely, but could happen. Could you please modify your code to read from both the input and the environment variable and prefer the environment variable if set for compatibility?
I understand, but if I do this I'll have the same issue that I've got by using main
branch.
Since Gitea runner always set GITHUB_TOKEN
env, it will always enter the condition, that's why I try with an action input
.
I tried to force GITHUB_TOKEN
to be empty or null on workflow and specific step, but the variable seems to be set.
I'll try to do some more tests.
Hi @nicolas-brousse unfortunately, this won't work and will break GitHub. Would you want @bencurio and myself to take care of it in a separate PR? I can make the changes and @bencurio has a Forgejo instance available for testing.
Hi @janosdebugs, sure. Feel free if it's more comfortable for you. I'll also be available to do some tests on my Gitea instance if you want by the way.
Hey @nicolas-brousse could you give #23 (forgejo-support branch) a try please?
@janosdebugs it works on Gitea runner :relieved:
Thanks @nicolas-brousse I'll try to get that merged then. Closing in favor of #23
Hey @nicolas-brousse thank you for your patience. ~You can use it by referencing the commit ID directly: da3271e0a2f8b8552a91e37cf85d03622c328ab7
. I'll try to get this into a proper release soon too.~ Shipped as v1.0.2. :)
Trying to use this action in my Gitea repository and CI. Gitea runner is really close to GitHub runner and follow a lot of common configuration to be mostly compliant with exiting GH actions.
Gitea use
GITHUB_TOKEN
env var but I guess the token is in really a Gitea token. So this make thegetRelease
method fail (failed fetching releases
).To fix that I moved the
process.env.GITHUB_TOKEN
call in an action input. So I'm able to do the following:Bit the way I make
github_token
input action use github token by default, to make the action will still run as actually on GitHub runners.I can imagine you are not intent to maintain your action for other services than GitHub, but since this is a minimal change, I'm opening this PR.
Let me know what do you think about, and if you need some changes from me.