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

File parameter doesn't work for Release job #20

Open
JonathanLefebvre opened this issue Dec 29, 2021 · 2 comments
Open

File parameter doesn't work for Release job #20

JonathanLefebvre opened this issue Dec 29, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@JonathanLefebvre
Copy link

JonathanLefebvre commented Dec 29, 2021

Orb version: 2.0.0 and earlier

What happened:

While configuring the workflow. I notice no matter what I do or inject in files I have always the message : stat /tmp/workspace/artifacts/dist.zip: no such file or director

Here is the extraction of my config.yml

jobs:
      - app_build:
          filters:
            branches:
              only:
                - master
      - github-cli/release:
          pre-steps:
            - *attach_workspace
            - run: 
                command: |
                  ls -la /tmp/workspace/artifacts
          context:
            - GITHUB_CREDS
          tag: << pipeline.git.branch >>-<< pipeline.number >>-dev
          title: << pipeline.git.branch >>-<< pipeline.number >>-dev
          prerelease: true
          files: /tmp/workspace/artifacts/dist.zip  # <-- This doesn't work
          requires:
            - app_build
          filters:
            branches:
              only:
                - master

/tmp/workspace/ come from my workspace attachment. with the folder artifacts created by app_build

Expected behavior:

files should be able to find a file from anywhere
If the ls in pre-step can see the file, so should the release task.

output of ls

#!/bin/bash -eo pipefail
ls -la /tmp/workspace/artifacts

total 62900
drwxr-xr-x 2 circleci circleci       22 Dec 29 20:06 .
drwx------ 3 circleci circleci       23 Dec 29 20:06 ..
-rw-r--r-- 1 circleci circleci 64409035 Dec 29 20:06 dist.zip
CircleCI received exit code 0

Additional Information:

From my code, you can see I have a workspace between both jobs

I found the workaround by doing the post-steps and uploading the artifact after the release is created

jobs:
      - app_build:
          filters:
            branches:
              only:
                - master
      - github-cli/release:
          pre-steps:
            - *attach_workspace
            - run: 
                command: |
                  ls -la /tmp/workspace/artifacts
          context:
            - GITHUB_CREDS
          tag: << pipeline.git.branch >>-<< pipeline.number >>-dev
          title: << pipeline.git.branch >>-<< pipeline.number >>-dev
          prerelease: true
          post-steps:
            - run:
                command: |
                  gh release upload << pipeline.git.branch >>-<< pipeline.number >>-dev /tmp/workspace/artifacts/dist.zip
          requires:
            - app_build
          filters:
            branches:
              only:
                - master
@JonathanLefebvre JonathanLefebvre added the bug Something isn't working label Dec 29, 2021
@zdryan
Copy link

zdryan commented Jul 15, 2023

Has any progress been made with this - I am encountering the same issues with version 2.2.0.

@Thesephi
Copy link

Thesephi commented Sep 29, 2023

I'd love to confirm that I'm stumbling upon the same issue on 2.2.0. What I notice:

  • if we call gh release create <tag> "$@" (as in the orb source) then it fails (with the stat .... no such file or directory error)
  • if we call gh release create <tag> $@ (so without the double quotation marks) then it may work (but how it interoperates with other logic intents in the orb source is another story)

I'm aware we can have workarounds, but as a frequent CircleCI user, I really look forward to using the "mainstream" approach in a successful & officially documented way :)

If I could help with anything please ping me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants