Build a context value with a repo name

Hello

Is there a parameter pipeline for the name of the Github repo?
Or a way to build context from the name of repo github?

In fact I need to build the context in the way:

workflow:
  build:
      - build-oci-image:
          name: build-image-staging
          context:
            - staging_<< pipeline.parameters.repo-name >>
          filters:
            branches:
              ignore:
                - prod
          requires:
            - build-other
      - build-oci-image:
          name: build-image-prod
          context:
            - production_<< pipeline.parameters.repo-name >>

Hi @mysolo – Welcome to Discuss!

At the moment there isn’t a pipeline parameter for repository name, the closest we have is pipeline.project.git_url but that will be a URL like https://github.com/circleci/circleci-docs and not just the repo. If that won’t work for your purposes, then you could use a combination of our built-in environment variables and the Dynamic Configuration feature.

So for your setup workflow you would pass down the CIRCLE_PROJECT_REPONAME into a new pipeline variable, like repo-name which then can be used in your configuration file accomplishing what you are looking to do.

We have some good additional reading about dynamic configs here:

I hope the above helps!
-Nick

Thanks.

I actually use a parameter variable:

parameters:
  repo-name:
    type: string
    default: "my-repo"

It’s a not good but it’s extremely simple to recover the repo name that make a whole dynamic configuration.

Thierry