Skip to main content

How to always execute an action?

caution

This documentation is for an older version of Dagger, which is no longer actively maintained.

We encourage you to upgrade and refer to the documentation for the most current version.

If you cannot upgrade to the latest version, please contact us in the help forum on Discord. When contacting us, please let us know why you cannot move to the latest version. From there, our team will work with you on your use case.

Dagger implemented a way to invalidate cache for a specific action.

The docker.#Run and core.#Exec actions have an always field (which means "always run"):

// If set to true, the cache will never be triggered for that specific action.
always: bool | *false

Any package composed on top of it (bash.#Run for example) also exposes this field as it will inherit it from docker.#Run:

test: bash.#Run & {
always: true
...
}
caution

Any dependent actions will also be retriggered.