Passing inputs to policies from hook scripts
We would like the ability to pass additional data to policies, particularly the Push policy, from hook scripts outputs. For us, this would enable us to call the atmos command atmos describe affected (documented here) and use the output of that command in our policies to determine if we should trigger Runs or not.
This goes the same if we’re using something like terramate with their terramate list --changed command (documented here).
Terragrunt plans on adding support for this type of functionality soon as well, which also means that this is something that will come up and be beneficial with the larger community.
- Workaround
- None that I know of
Log in to comment and vote
Comments4
Aleksandra Cieslak
Jul 29
Hi,
thanks for the detailed context here. Unfortunately, I need to close this feature request. Passing hook script outputs into policy evaluation would require a structural change to our policy architecture, which we're not planning to take on.
Yellow Coral
Feb 18, 2025
This would be super useful, and would be a critical functionality for my current use case right now. If this was a feature right now, I’d take FULL advantage of it.
I’m currently using Spacelift’s Notification policies with Slack. The default inputs is limited in terms of the GitHub/VCS information (e.g. only providing commit SHA, PR #, author, etc.). I want additional information, such as who merged the PR.
I would be able to get that via the GitHub API as a hook, then pass that into the notification policy so I can send out a Slack message about that.
This way, it can all be done natively and cleanly via Spacelift, rather than having to be hacky and inconsistent to send one Slack message via a script and another via notification policy.
Yellow Coral
Feb 18, 2025
ADDITIONALLY, there are some steps I perform in those scripts. I’d like to pass the status/output of those scripts to the notification policy to post!
Primarily, this makes everything stay within the Spacelift native Slack ecosystem, instead of having to write a new system to handle Slack notifications.
Natalia Gazda
Feb 5, 2025
Bigger problem: how do we allow users to provide more context to push policies? Push to WB & James.