Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Error uploading to https://github.our_enterprise.com/storage/releases/xxxx/files: 404 #72

Open
s850042002 opened this issue Dec 7, 2020 · 1 comment

Comments

@s850042002
Copy link

We're testing this action in our github enterprise environment, but we keep getting the following error message.

Run actions/upload-release-asset@v1
  with:
    upload_url: https://github.our_enterprise.com/api/uploads/repos/our_rganization/ConsoleAction/releases/2251/assets{?name,label}
    asset_path: ./ConsoleAction_x64.zip
    asset_name: ConsoleAction_x64.zip
    asset_content_type: application/zip
  env:
    GITHUB_TOKEN: ***
##[error]Error uploading to https://github.our_enterprise.com/storage/releases/2251/files: 404

We use the example code without any modification. And confirm the artifact exist.

      - name: Create Release
        id: create_release
        uses: actions/create-release@latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }} 
          release_name: Release ${{ github.ref }}

      - name: Upload Release Asset (x64)
        id: upload-release-asset-x64
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ./ConsoleAction_x64.zip
          asset_name: ConsoleAction_x64.zip
          asset_content_type: application/zip

Why does it upload the artifact to https://github.our_enterprise.com/storage/release?
And how do we fix it?

@MarcusNotheis
Copy link

MarcusNotheis commented Jan 20, 2021

Hey,
I came across the same issue and was able to work around it by using my personal access token instead of the default ${{ secrets.GITHUB_TOKEN }}.
With ${{ secrets.GITHUB_TOKEN }} I got the 404 error as well, with ${{ secrets.MY_SECRET_NAME_WITH_MY_TOKEN }} it worked find.
Could it be that the secrets.GITHUB_TOKEN has insufficient privileges for uploading release assets in GitHub Enterprise environments? We are running GitHub Enterprise Server 2.22.6.

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

No branches or pull requests

2 participants