Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent checkout if you have "persist_to_workspace" #68

Open
Alejandroid17 opened this issue Feb 17, 2023 · 3 comments
Open

Prevent checkout if you have "persist_to_workspace" #68

Alejandroid17 opened this issue Feb 17, 2023 · 3 comments
Labels
backlog Identified as a backlog item, often combined with low-priority and help-wanted labels enhancement New feature or request

Comments

@Alejandroid17
Copy link

Orb version:

circleci/[email protected]

What happened:

When I try to persist the working environment persist_to_workspace and use it, to avoid the checkout step, I don't succeed.

# config.yml

...

jobs:
  # Checkout custom job to only clone the latest changes.
  custom-checkout:
    docker:
      - image: cimg/base:2023.02
    steps:
        ...
      - run:
          name: Clone bitbucket repository
          command: git clone --depth 5 "$CIRCLE_REPOSITORY_URL" --branch "$CIRCLE_BRANCH"
      - persist_to_workspace:
          root: /home/circleci/
          paths:
            - project

workflows:

  default-workflow:
    jobs:
      - custom-checkout
      - path-filtering/filter:
          requires:
            - custom-checkout
          name: Filter workflows
          mapping: |
            .*.py test-back true
          base-revision: fast-track
          config-path: .circleci/workflows/default-workflows.yml
          workspace_path: /home/circleci/

image

Expected behavior:

Attach workspace and avoid project cloning.

Thanks!! :)

@Alejandroid17 Alejandroid17 added the bug Something isn't working label Feb 17, 2023
@morrisonlevi
Copy link

Perhaps a perform_checkout: boolean type of config option to the orb would be better than trying to automatically detect if it should perform a checkout? Dunno.

In any case, for people who perform custom checkout steps, it would be nice to have something like this available.

@Fernando-Abreu Fernando-Abreu added enhancement New feature or request backlog Identified as a backlog item, often combined with low-priority and help-wanted labels and removed bug Something isn't working labels Jun 20, 2023
@Fernando-Abreu
Copy link
Collaborator

I've added it to our backlog

@adrogon
Copy link

adrogon commented Jun 23, 2023

For reference, please notice how it was solved in the Continuation Orb: https://github.com/CircleCI-Public/continuation-orb/pull/36/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Identified as a backlog item, often combined with low-priority and help-wanted labels enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants