Need CIRCLE_PREVIOUS_WORKFLOW_ID env var exposed

Hi,

Would be possible to expose a CIRCLE_PREVIOUS_WORKFLOW_ID as an environment variable in a similar way you already do with CIRCLE_PREVIOUS_BUILD_NUM?

We want to use it in the cache key for our elixir compiled binaries.

The cache example in the Language Guides: Elixir is so good since it will keep a too outdated version of the compile binaries in the cache and, as we add more and more changes to the codebase, it requires to compile almost everything again.

We would like to do something like this:

steps:
  - restore_cache:
      keys:
        - build-cache-{{ .Branch }}-prod-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
        - build-cache-prod

  - run: mix compile

  - save_cache:
      key: build-cache-{{ .Branch }}-prod-{{ .BuildNum }}
      paths: "_build"
  - save_cache:
      key: build-cache-prod
      paths: "_build"

Regards,
Hugo

Hello @hugomaiavieira

Thanks for the suggestion. Have you seen our public ideas portal? https://ideas.circleci.com/ideas

Please consider sharing this idea there. This allows users to vote and comment on feature requests to get as much community feedback as we can. This also allows us to more easily contact users interested in these features once they become available.

Done :+1:

1 Like