You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compose GitHub actions as a single GitHub action #438
What I like from GitHub action is we can ensure that our action is up-to-date with available fixes in the upstream. E.g.: we can use actions/checkout@v2 and the CI will still run with the latest version of checkout@v2.
Unfortunately, this facility can't be used while we're creating a GitHub action. I think it's better if we can compose multiple GitHub actions into a single GitHub action, or maybe just use one or two GitHub actions for the trivial tasks and continue the other in Javascript or Docker container.
This is an imaginary action.yml to serve as an example, maybe it's cool if we can do this:
We are picking up work here so keep an eye out for activity. We will update things as we go.
Reacted by Philip Jägenstedt, Riccardo Porreca, Tibor Kotosz, Joshua Napoli, Pratik Soni, Zo Obradovic, Zadkiel AHARONIAN, Tom Crockett, Bogomir Engel, Chris Naismith and 30 more
Reacted by Nikita Golubov, James Lucktaylor, Ethan Chiu, Santiago "Momo" Marín, Evan Purkhiser, Nicolas Peugnet, Abdud Dayan Adeeb, Alessandro Muntoni, Patrick Hulce, Lokesh Gopu and 38 more
Reacted by Marcel de Graaf, Alejandro Pedraza, Jared Dobson, Zadkiel AHARONIAN, Bogomir Engel, Goto Hayato, Chris Naismith, Victor Malov, Ygor Sad, 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) and 5 more
This is our team's number 1 pain point with GH actions, would love to see something like this implemented, or alternatively support for YAML anchors (how we used to accomplish DRY with Travis).
Reacted by Filipe Laíns, Aaron ("AJ") Steers, wi1dcard, Tim Swinkels, Ethan Chiu, Bogomir Engel, Armin, Victor Malov, Ygor Sad, Jossef Kadouri and 26 more
Reacted by Aaron ("AJ") Steers, Tim Swinkels, Bogomir Engel, Victor Malov, Ygor Sad, Julien Karst , Maciek Misztal and adarsh
Reacted by Aaron ("AJ") Steers, Tim Swinkels, Bogomir Engel, Victor Malov, Ygor Sad, Julien Karst , Maciek Misztal, Sebastian Bayerl and Michael Olson
This is our team's number 1 pain point with GH actions, would love to see something like this implemented, or alternatively support for YAML anchors (how we used to accomplish DRY with Travis).
YAML anchors may not be good enough. For the action below, we can not share common steps between jobs by YAML anchors.
A single step must be able to reference outputs of previous steps, and so in order to define a step in a centralized way, there must be a way to provide inputs to that step.
I like the idea of being able to define a composed set of steps as an action with inputs:
E.g.
composites:
init:
input:
- branchsteps:
- uses: actions/checkout@v2with: {{ input.branch }}
- actions/cache...
- actions/testjob1:
steps:
- if: {{ event == release }}run: ... set some output, on a e.g. my_varid: is_release
- uses: composites.initwith:
branch: steps.is_release.outputs.my_var
- run: ...
Reacted by wi1dcard, Abhay Sood, Zadkiel AHARONIAN, Bogomir Engel, Filip Štamcar, vikassd2012, Adam Haglund, Jørn Lomax, Petr Švihlík, Alexandre Miziara and 2 more
We are working through this scenario. The first feature we need to get working is multiple run steps, after which we would allow more complex action composition. Right now we plan to do it with a separate action template/definition.
You can see this work in progress for how we are going to support multiple run steps (then imagine this gets extended to more complicated steps (there is more technical work to support things like uses/etc): #591
Reacted by Ethan Chiu, Marshall An, wi1dcard, James Lucktaylor, Bogomir Engel, David Backeus, Tom Forbes, Raphael Manke, Florian Störkle, JD Courtoy and 10 more
Reacted by Patrik Ragnarsson, Ethan Chiu, Marshall An, Evan Sosenko, Billy Vong, Daisy Leigh Brenecki, James Lucktaylor, Bogomir Engel, Alessandro Muntoni, Tom Forbes and 11 more
Thanks for pointing that out @sidvishnoi , just read it. Looks like their long term plan is to support actions within actions and this is a step in that direction-- but for now they are just supporting run commands from different shells.
Reacted by Matt, Theo Berlin, KlarkC, Petr Švihlík and tong
The 'composite' action type allows us to run sequential commands natively, but is there any way to put together docker-based actions? For instance, I'd like one of the steps in the composite action to be running a docker action.
We still have work to do on this feature. I'm linking this issue: #646 so everyone can see we are totally aware of the future work to get "actions in actions" working fully. See that issues for what's left to do and the state of the world for this feature.
Reacted by Nihal Gonsalves, Manuel, James Lucktaylor, Kadamb Kaluskar, Oswaldo Freitas, Mike Lue, Matt, ilyazub, Patrick Linehan, Gabe Cook and 10 more
Reacted by Matt, Rogério Rodrigues de Alcântara, Julien Karst and Dmitri
FWIW and for googlers landing here, I don't see how the closing MR offers more than YAML replacement for simple intermediate/wrapper scripts. Qualitively speaking; there seem to be some consequences how workflow runs show up in the UI, which are of secondary concern IMHO.
In particular, the core issue of (transparently) calling another action has not been addressed, at all.
Both the MR and #646 express that being able to express multiple steps in YAML is a major stepping stone towards that. I don't necessarily follow -- another route, such as before-steps: <array of uses> would have seemed feasible as well -- but I'll take your word for it. #612 was dealing with the core issue, though, so #646 remains the issue to watch.
Reacted by Mitch Ryan, wi1dcard, Emil Ong, Areeb Jamal, Juan Julián Merelo Guervós, Glenn 'devalias' Grant, Michael Dong, Piotr, Jamie Haywood, Ryan Nett and 6 more
YAML anchors do everything I want, which includes sharing configuration not related to steps, i.e. stuff I want to share but don't want to run like container configuration.
To prove this to myself, I decided to create a .github/workflows-src/ directory with workflow yaml files which included anchors, but only defined under the top-level anchors key.
Here's an example (simplified) workflow yaml source file:
Maybe this is of some use to others here, but also possibly an example of what many of us are looking for with YAML anchors for the GitHub team.
(P.S. I'm a little confused by the anchor parsing concerns as I'm not sure if I could turn off anchors in the transformation script above, but you all know your codebase better than me, of course)
Reacted by Ilia Zlobin, Julien Karst , Austin S. Hemmelgarn, Matthew Rodusek, Jorge González, Matthew Planchard, Glenn 'devalias' Grant, Carlos González, Will Thompson, Chris Dosé and 24 more
Per @emilong's example I tried it in an example repo of mine and it's working wonderfully. I included functionality to automatically merge/flatten steps lists, as well.
You can check out the example here. Hope someone finds it useful.
Reacted by Emil Ong, James Lucktaylor, Petr Švihlík and Coroliov Oleg
Activity
TingluoHuang commentedon Apr 21, 2020
It feels like a template reuse scenario, so you can share a list of reusable steps with others.
@chrispat @ericsciple for an idea.
ericsciple commentedon Apr 21, 2020
Yep it's something we want to do. Currently behind other priorities.
hross commentedon Jun 14, 2020
We are picking up work here so keep an eye out for activity. We will update things as we go.
pelotom commentedon Jul 13, 2020
This is our team's number 1 pain point with GH actions, would love to see something like this implemented, or alternatively support for YAML anchors (how we used to accomplish DRY with Travis).
vanppo commentedon Jul 14, 2020
YAML anchors may not be good enough. For the action below, we can not share common steps between jobs by YAML anchors.
Syntax below may be the resolution.
Enrico2 commentedon Jul 14, 2020
A single step must be able to reference outputs of previous steps, and so in order to define a step in a centralized way, there must be a way to provide inputs to that step.
I like the idea of being able to define a composed set of steps as an action with inputs:
E.g.
hross commentedon Jul 15, 2020
We are working through this scenario. The first feature we need to get working is multiple run steps, after which we would allow more complex action composition. Right now we plan to do it with a separate action template/definition.
You can see this work in progress for how we are going to support multiple run steps (then imagine this gets extended to more complicated steps (there is more technical work to support things like uses/etc): #591
Also see the full ADR for more detail on syntax/usage: https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md
[GitHub] Add Release workflow to publish binaries
10 remaining items
ThibaultVlacich commentedon Aug 7, 2020
@timharris777 The comment right above yours...
timharris777 commentedon Aug 7, 2020
Sorry @ThibaultVlacich, I'm not following you. This is already released and I have been using it today. It was in the latest runner features from like 9 days ago and it was announced today. https://github.blog/changelog/2020-08-07-github-actions-composite-run-steps/
sidvishnoi commentedon Aug 7, 2020
@timharris777 See #646
timharris777 commentedon Aug 7, 2020
Thanks for pointing that out @sidvishnoi , just read it. Looks like their long term plan is to support actions within actions and this is a step in that direction-- but for now they are just supporting run commands from different shells.
mikedrexler commentedon Aug 7, 2020
Hi @timharris777 ! It would appear that your answer arrived before I saw your question. Tracking in the Chick-Fil-A customer repository at https://github.com/githubcustomers/Chick-Fil-A/issues/11.
nsheff commentedon Aug 7, 2020
The 'composite' action type allows us to run sequential commands natively, but is there any way to put together docker-based actions? For instance, I'd like one of the steps in the composite action to be running a docker action.
razor-x commentedon Aug 8, 2020
@nsheff Check out #646
hross commentedon Aug 17, 2020
We still have work to do on this feature. I'm linking this issue: #646 so everyone can see we are totally aware of the future work to get "actions in actions" working fully. See that issues for what's left to do and the state of the world for this feature.
reitzig commentedon Oct 20, 2020
FWIW and for googlers landing here, I don't see how the closing MR offers more than YAML replacement for simple intermediate/wrapper scripts. Qualitively speaking; there seem to be some consequences how workflow runs show up in the UI, which are of secondary concern IMHO.
In particular, the core issue of (transparently) calling another action has not been addressed, at all.
Both the MR and #646 express that being able to express multiple steps in YAML is a major stepping stone towards that. I don't necessarily follow -- another route, such as
before-steps: <array of uses>would have seemed feasible as well -- but I'll take your word for it. #612 was dealing with the core issue, though, so #646 remains the issue to watch.emilong commentedon Nov 6, 2020
YAML anchors do everything I want, which includes sharing configuration not related to steps, i.e. stuff I want to share but don't want to run like container configuration.
To prove this to myself, I decided to create a
.github/workflows-src/directory with workflow yaml files which included anchors, but only defined under the top-levelanchorskey.Here's an example (simplified) workflow yaml source file:
Then I preprocess in a
pre-commithook with this script:Maybe this is of some use to others here, but also possibly an example of what many of us are looking for with YAML anchors for the GitHub team.
(P.S. I'm a little confused by the anchor parsing concerns as I'm not sure if I could turn off anchors in the transformation script above, but you all know your codebase better than me, of course)
Lack of actions/runner#438 makes packaging the CD workflow reusably m…
rhyek commentedon Feb 9, 2021
Per @emilong's example I tried it in an example repo of mine and it's working wonderfully. I included functionality to automatically merge/flatten
stepslists, as well.You can check out the example here. Hope someone finds it useful.
build_and_test.yml: Remove Anchors
Testing parallel builds of branches using anchors actions/runner#438 …