Declaratively define GitHub actions #26424
-
tl;dr: Define a GitHub Action using the workflow syntax, allowing reuse of other actions across repositories without creating own JS based wrapper actions. Presently, there are two ways to define GitHub actions - either using JavaScript or Docker. If we want to reuse some action, we need to clone/install it and then make our own wrapper around it. It becomes more difficult when the action doesn’t provide a programmatic API. The workflow syntax already allows (re)use of various actions, but then one needs to copy same workflow across multiple projects. It would be great if we can define new GitHub actions by using the workflow syntax. In JavaScript, we may write an action as:
vs an
Now copying (and updating) above in a workflow across repositories will be cumbersome. So, users can use above action in a workflow as:
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Thanks for your feedback. GitHub takes your suggestions very seriously, and the suggestions are very helpful for improving GitHub Actions. |
Beta Was this translation helpful? Give feedback.
-
Thanks. Shared through the feedback channel you provided. |
Beta Was this translation helpful? Give feedback.
-
Sure. Thanks for your suggestions. |
Beta Was this translation helpful? Give feedback.
-
Hey @sidvishnoi, If I’m understanding your comments correctly, you are wanting a way to write an action using the yaml syntax. If so, I’m happy to report its on our radar, though I’m unable to give a timeframe for when it will be available. We have an ADR open to build this on the actions runner here. To begin, it will only support We are more than happy to take feedback and questions on the ADR if you have additional feedback! |
Beta Was this translation helpful? Give feedback.
-
Yes!
This is exciting 🎉 Thank you! |
Beta Was this translation helpful? Give feedback.
-
This seems possible today using an action like actions/github-script which allows you to inline javascript . You can find an example here https://github.com/actions/github-script#comment-on-an-issue |
Beta Was this translation helpful? Give feedback.
-
Composite run steps actions are also available since August: docs.github.comCreating a composite run steps action - GitHub Docs |
Beta Was this translation helpful? Give feedback.
Hey @sidvishnoi,
If I’m understanding your comments correctly, you are wanting a way to write an action using the yaml syntax. If so, I’m happy to report its on our radar, though I’m unable to give a timeframe for when it will be available.
We have an ADR open to build this on the actions runner here. To begin, it will only support
run
steps, we will later expand it to includeuses
steps as well.We are more than happy to take feedback and questions on the ADR if you have additional feedback!