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

Unable to upload assets #6

Open
Genysys opened this issue May 28, 2022 · 4 comments
Open

Unable to upload assets #6

Genysys opened this issue May 28, 2022 · 4 comments

Comments

@Genysys
Copy link

Genysys commented May 28, 2022

I am trying to upload a binary with in git action using https://github.com/alexellis/upload-assets . Here is the snippet of where I call it.

      - name: Prepare executables for uploading
        run: |
          mkdir executables
          # mv target/production/node-template executables/node-template
          mv target/debug/foo executables/foo

      - name: Upload node template executables to assets
        uses: alexellis/upload-assets@0.3.0
        env:
          GITHUB_TOKEN: ${{ github.token }}
        with:
          asset_paths: '["executables/*"]'

Unfortunately , I get the error:

Run alexellis/upload-assets@0.3.0
Error: Not Found

I would appreciate any pointers on resolving this , as I can't understand why it can't find the binary

@vandot
Copy link

vandot commented Jun 8, 2022

I am getting the same error Error: Not Found
Tried adding contents: write permission didn't helped, tried debugging it on the runner and this section of code works, it prints correct file

      if(assetPath.indexOf("*") > -1) {
        const files = glob.sync(assetPath,{ nodir: true })
        for (const file of files) {
            paths.push(file)
        }
      }

Tried debugging workflow with ACTIONS_STEP_DEBUG: true but no additional logs, this is all

Update:
So Not Found means release not found and not files 🤦

@nazar-pc
Copy link

Yes, it must be release or pre-release. Drafts and tags don't support uploading of files.

@vernak2539
Copy link

vernak2539 commented Jul 25, 2022

Hello! I'm running into this same problem. In my action, the second step is creating a release. I've confirmed that the tag and release are both created, so I'd think that the upload can happen.

My workflow looks like this

name: Build and Publish
on: [push]
jobs:
  build_and_publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: rymndhng/release-on-push-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          bump_version_scheme: patch
      - uses: actions/setup-go@v3
        with:
          go-version: '1.17.6'
      - run: make build_all
      - uses: actions/upload-artifact@v3
        with:
          name: package-darwin-arm46
          path: build/package-darwin-arm46
      - name: Upload release binaries
        uses: alexellis/upload-assets@0.2.2
        env:
          ACTIONS_STEP_DEBUG: true
          GITHUB_TOKEN: ${{ github.token }}
        with:
          asset_paths: '["./build/package*"]'

I've tried with both GITHUB_TOKEN: ${{ github.token }} and GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} to no avail. I tried to set up the debugging Checking this again, seems I did it wrong Checked, still no extra output. Output:

Run alexellis/upload-assets@0.2.2
  with:
    asset_paths: ["./build/package*"]
  env:
    GITHUB_TOKEN: ***
    ACTIONS_STEP_DEBUG: true
{ owner: 'vernak[2](https://github.com/vernak2539/repo/runs/7497825506?check_suite_focus=true#step:10:2)5[3](https://github.com/vernak2539/repo/runs/7497825506?check_suite_focus=true#step:10:3)9', repo: 'repo' } refs/heads/master
Error: Not Found

Any thoughts? (the repo is a private one, but the tokens should have access)

@nazar-pc
Copy link

You're missing this in your workflow:

    permissions:
      contents: write
      packages: write

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

4 participants