-
According to Metadata syntax for GitHub Actions - GitHub Docs, it looks like there isn’t the ability to specify steps for the action to be executed “post run”. This capability exists for Javascript and Docker actions but not composite. Is that correct? Just making sure I’ve correctly interpreted the documentation. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Yes, it is correct. The pre and post option are not available to the composite run steps actions. Generally, you can think of the composite action as just a combination of some run steps. When you run the a composite action in the workflow, it is functionally equivalent to directly executing the combined run steps in the workflow. If you want to run some pre or post scripts for the composite action, you can directly combine the run as a step in the action:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the clarification/confirmation.
brightran:
Unfortunately (for me), I was primarily wanting to use the composite action as a means of creating an action that allowed a broader support of languages other than Docker and Javascript. So, in that regard, I needed the post script to always run in the workflow even if a previous step had failed. Ultimately, I ended up going with a Javascript Action. |
Beta Was this translation helpful? Give feedback.
-
Unlike directly executing the run steps in the job, the option “runs.steps.if” is not supported. So you can’t set an if conditional (e.g. if: always()) to let a run step to always run when any previous run steps is failed in the composite action. |
Beta Was this translation helpful? Give feedback.
-
Hope |
Beta Was this translation helpful? Give feedback.
-
Post scripts from actions that your composite action executes still run
GitHub - webiny/action-post-run: Enables executing custom commands once a...Enables executing custom commands once a workflow job has ended. - GitHub - webiny/action-post-run: Enables executing custom commands once a workflow job has ended. to get it to work |
Beta Was this translation helpful? Give feedback.
-
As another option, you can use run-and-post-run-action, which allows you to define both |
Beta Was this translation helpful? Give feedback.
@pcolmer,
Yes, it is correct. The pre and post option are not available to the composite run steps actions.
Generally, you can think of the composite action as just a combination of some run steps. When you run the a composite action in the workflow, it is functionally equivalent to directly executing the combined run steps in the workflow.
If you want to run some pre or post scripts for the composite action, you can directly combine the run as a step in the action:
Set the first step in the composite action to run some pre scripts to set up some preparations for the subsequent run steps in the composite a…