Skip to content
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

Use go-githubactions #153

Closed
3 tasks done
ianlewis opened this issue Jun 2, 2022 · 8 comments
Closed
3 tasks done

Use go-githubactions #153

ianlewis opened this issue Jun 2, 2022 · 8 comments
Assignees
Labels
area:detect-workflow Issue with the detect-workflow Github action area:library Issue with the base reusable Go library type:feature New feature or request

Comments

@ianlewis
Copy link
Member

ianlewis commented Jun 2, 2022

https://github.com/sethvargo/go-githubactions does a lot of the same stuff as the github package but does many things better.

For example, it gets github context values via the built-in environment variables rather than requiring it be serialized to json and added to a GITHUB_CONTEXT environment variable. This is desirable because the github context doesn't seem to be available inside of an actions.yml so it can't be used by reusable actions.

Open issues:

@ianlewis ianlewis added type:feature New feature or request area:detect-workflow Issue with the detect-workflow Github action area:library Issue with the base reusable Go library labels Jun 2, 2022
@ianlewis ianlewis added this to the v1 milestone Jun 2, 2022
@ianlewis ianlewis self-assigned this Jun 2, 2022
@laurentsimon
Copy link
Collaborator

laurentsimon commented Jun 2, 2022

Do we need this dependency? If we can easily implement the same,let's avoid adding yet another dependency to manage. In general, in the builder, we should minimize dependencies as much as possible.

Wdut?

@ianlewis
Copy link
Member Author

ianlewis commented Jun 2, 2022

go-githubactions depends only on go-envconfig which has essentially no dependencies so transients should be minimal. I'd kind of prefer using it because it would require a lot of manual code to get context from env vars and it pretty much does exactly what we want.

It also does a couple other things nicely like dealing with newlines when writing output commands.

@ianlewis
Copy link
Member Author

ianlewis commented Jun 2, 2022

It's also @sethvargo so I'm reasonably confident in the management of both packages.

@ianlewis ianlewis removed this from the v1 milestone Jun 3, 2022
@ianlewis
Copy link
Member Author

ianlewis commented Jun 3, 2022

I'll look a bit more into how the github context can be used in custom actions in #164 which may make this mute. Removed from the v1 milestone since it's not really ugent.

@sethvargo
Copy link

@sethvargo? Never heard of 'em 😄

@ianlewis
Copy link
Member Author

ianlewis commented Jun 3, 2022

@sethvargo? Never heard of 'em 😄

I may have been wrong about Seth's reliability. 😆

@ianlewis
Copy link
Member Author

I'm going to close this in favor of #164

@laurentsimon
Copy link
Collaborator

+1, one less dependency to main and be worried about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:detect-workflow Issue with the detect-workflow Github action area:library Issue with the base reusable Go library type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants