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

Avoid having to do your own checkout in user workflows #5

Open
jspaaks opened this issue Jun 22, 2021 · 3 comments
Open

Avoid having to do your own checkout in user workflows #5

jspaaks opened this issue Jun 22, 2021 · 3 comments

Comments

@jspaaks
Copy link
Member

jspaaks commented Jun 22, 2021

so instead of

        - name: checkout
          uses: actions/checkout@v2      
        - name: Create a draft deposition in a new collection
          env:
            ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}        
          uses: zenodraft/[email protected]

it would be better to have

        - name: Create a draft deposition in a new collection
          env:
            ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}        
          uses: zenodraft/[email protected]
@kaat0
Copy link

kaat0 commented Apr 1, 2022

Hi

I just want to submit a new release inside an artifact with filenames from a previous job. the checkout does not seem necessary to me.

- uses: actions/download-artifact@v3

- name: "uploading to zenodo sandbox"
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}
  uses: zenodraft/[email protected]
  with:
    filenames: artifact/release.zip

@jspaaks
Copy link
Member Author

jspaaks commented Apr 4, 2022

Thanks for the feedback. Just to clarify, the code snippet you posted works, right? Without doing the checkout I mean. Although you may need to fiddle a bit with the path and/or name properties of download-artifact.

@kaat0
Copy link

kaat0 commented Apr 4, 2022

No, it does not work. It will throw an error for missing some git (I do not remember the exact error, but you will probably know which one!)
I do the checkout anyway to avoid the error.

My current workaround for the path and name is to mv the file out of the artifact folder.
For documentation purposes:
with the code snippet above, the file name on zenodo will be artifact/release.zip instead of release.zip.
Therefore, I use the following code in my github action:

# download artifact in folder artifact/
- uses: actions/download-artifact@v3
# mv release.zip one level up
- run: |
     mv ./artifact/release.zip ./

Could you consider options like the following?

file_path: artifact/release.zip
file_name: release.zip

My knowledge of typescript/javascript is limited; otherwise, I would try to make a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants