gidgethub / gidgethub

An async GitHub API library for Python

Home Page:https://gidgethub.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for Actions environment files

brettcannon opened this issue · comments

I can implement this :)

Also, according to this blog post, both set-env and add-path commands are going to be removed on November 16 which means we should probably remove the following two tests as well:

Should we aim for this feature in v5.0.0?

@dhruvmanila thanks for being willing to give it a shot!

You're right, those tests could be removed.

As for implementing, do look at how actions/core does it in JavaScript (we already have their MIT license covered so you can copy the algorithm as appropriate).

And we can make this part of a 5.0 release.

Awesome! I took a look at how actions/core are doing it and there's one additional thing they are implementing in their API.

The action that creates or updates the environment variable does not have access to the new value, but all subsequent actions in a job will have access.

According to GitHub, the current action cannot access the new environment variable or the modified path but only the subsequent actions can.

The actions/core library is adding the environment variable and path to their respective file but additionally, they are manually injecting them so that even the current action can access them. Should we also implement this?

https://github.com/actions/toolkit/blob/main/packages/core/src/core.ts#L43
https://github.com/actions/toolkit/blob/main/packages/core/src/core.ts#L74

Also, you have mentioned in here that we are not performing any string conversion, should we change that as I think it just requires casting the parameter to str or am I wrong?

The actions/core library is adding the environment variable and path to their respective file but additionally, they are manually injecting them so that even the current action can access them. Should we also implement this?

Yes, I think we should.

Also, you have mentioned in here that we are not performing any string conversion, should we change that as I think it just requires casting the parameter to str or am I wrong

You're correct that's all it would take, but I don't want to change that as debugging passing in an object like that is really hard since every object can be converted to a string.