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

Update workflows using a YAML parser instead of overwriting #267

Open
zkamvar opened this issue Mar 25, 2022 · 3 comments
Open

Update workflows using a YAML parser instead of overwriting #267

zkamvar opened this issue Mar 25, 2022 · 3 comments

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Mar 25, 2022

Right now we update our workflows by overwriting the ones we need to overwrite. It would be a good idea to provide a way to update them in a way that only modifies the sandpaper-specific steps so that people can add their own steps if they want to.

@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 25, 2022

Note, a custom parser is probably in order to allow for "on":

vubiostat/r-yaml#5 (comment)

@sabaferdous12
Copy link

That would be amazing Zhian..

@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 13, 2023

There is a go-based tool that can parse YAML and output it to different formats called yq.

It can be downloaded as a standalone binary and it has an associated GitHub Action. It is a perfect tool for this task for doing these kind of fine-grained updates to the GitHub actions because it has tools for updating individual nodes with contents of files: https://mikefarah.gitbook.io/yq/operators/assign-update#update-node-from-another-file

I got this from hrbrmstr's 2023-03-13 daily drop.

The only downside right now is that we can not easily make this a part of {sandpaper} as it is written in Go, which can not (afaik) be embedded in an R package. There are workarounds such as having the binary installed into an application directory, but I would much rather implement something that works via GitHub first.

@zkamvar zkamvar changed the title Use yaml package to update workflows Update workflows using a YAML parser instead of overwriting Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants