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

No zip file created #52

Closed
om4csaba opened this issue Sep 4, 2020 · 5 comments
Closed

No zip file created #52

om4csaba opened this issue Sep 4, 2020 · 5 comments
Labels
type:bug Something isn't working.

Comments

@om4csaba
Copy link

om4csaba commented Sep 4, 2020

Describe the bug
No zip file created with generate-zip: true setting.

Steps to Reproduce

  1. Configure an action with a subsequent action that awaits for the generated artifacts
  2. Let Github run the action
  3. Asset action fial with ##[error]Not Found

Expected behavior
The asset action can grab access to the generated zip file.

Additional context
I only tested with a simple plugin without build script Mentioning here because there is a vague description of zip file creation without build script in the README, but I did not properly understand the relationship between build step and the zip file creation.

I also tried with two different asset action: actions/upload-release-asset@v1 and svenstaro/upload-release-action@v2.

You can find my config here: https://github.com/OM4/weatherzone/blob/master/.github/workflows/deploy.yml
And the failed action here: https://github.com/OM4/weatherzone/runs/1066339241?check_suite_focus=true

@om4csaba om4csaba added the type:bug Something isn't working. label Sep 4, 2020
@dinhtungdu
Copy link
Collaborator

@om4csaba Can you share the workflow file that you used actions/upload-release-asset@v1?

@om4csaba
Copy link
Author

@dinhtungdu This was that: https://github.com/OM4/weatherzone/blob/7198cce5cda7ff8c34ec17d9ae55873f169e5f1b/.github/workflows/deploy.yml

Content copied here:
name: Deploy to WordPress.org
on:
  release:
    types: [published]
jobs:
  tag:
    name: New release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: WordPress Plugin Deploy
        id: deploy
        uses: 10up/action-wordpress-plugin-deploy@stable
        with:
          generate-zip: true
        env:
          SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
          SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
      - name: Upload release asset
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.PLUGINS_GITHUB_TOKEN }}
        with:
          upload_url: ${{ github.event.release.upload_url }}
          asset_path: ${{github.workspace}}/${{ github.event.repository.name }}.zip
          asset_name: ${{ github.event.repository.name }}.zip
          asset_content_type: application/zip

@dinhtungdu
Copy link
Collaborator

@om4csaba Why do you use PLUGINS_GITHUB_TOKEN but not GITHUB_TOKEN? Is PLUGINS_GITHUB_TOKEN a personal access token?

Btw, I can't reproduce your issue. I forked your repo and make a test release and the zip file is created and uploaded to release without a problem. Note that I use GITHUB_TOKEN and a modified version of this action (stripped out the svn commit parts).

@om4csaba
Copy link
Author

The GITHUB_TOKEN was taken for other application, and yes the PLUGINS_GITHUB_TOKEN is a personal access token. I will rename back to GITHUB_TOKEN and try again. Thanks!

@helen
Copy link
Collaborator

helen commented Aug 17, 2021

Apologies for the very belated response - I've updated the Action which had some logic I am surprised was previously working, and it also now emits a zip-path output param which you can then use in that step of the workflow instead of asset_path: ${{github.workspace}}/${{ github.event.repository.name }}.zip. See the readme for an example.

You also should not need to actually define GITHUB_TOKEN in your secrets, it's provided by GitHub in the Actions context whenever you include it in the environment.

If this is still an issue please do reopen this and link to the failed run again. Thanks!

@helen helen closed this as completed Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

3 participants