You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try{// Get authenticated GitHub client (Ocktokit): https://github.com/actions/toolkit/tree/master/packages/github#usageconstgithub=newGitHub(process.env.GITHUB_TOKEN);// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputsconstuploadUrl=core.getInput('upload_url',{required: true});constassetPath=core.getInput('asset_path',{required: true});constassetName=core.getInput('asset_name',{required: true});constassetContentType=core.getInput('asset_content_type',{required: true});// Determine content-length for header to upload assetconstcontentLength=filePath=>fs.statSync(filePath).size;// Setup headers for API call, see Octokit Documentation: https://octokit.github.io/rest.js/#octokit-routes-repos-upload-release-asset for more informationconstheaders={'content-type': assetContentType,'content-length': contentLength(assetPath)};// Upload a release asset// API Documentation: https://developer.github.com/v3/repos/releases/#upload-a-release-asset// Octokit Documentation: https://octokit.github.io/rest.js/#octokit-routes-repos-upload-release-assetconstuploadAssetResponse=awaitgithub.repos.uploadReleaseAsset({url: uploadUrl,
headers,name: assetName,file: fs.readFileSync(assetPath)});// Get the browser_download_url for the uploaded release asset from the responseconst{data: {browser_download_url: browserDownloadUrl}}=uploadAssetResponse;// Set the output variable for use by other actions: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputscore.setOutput('browser_download_url',browserDownloadUrl);}catch(error){core.setFailed(error.message);}
The text was updated successfully, but these errors were encountered:
According to actions/upload-release-asset#78, https://github.com/actions/upload-release-asset seems to bee removed from the marketplace, sadly. There is https://github.com/shogo82148/actions-upload-release-asset now, but I think doing a new github-script upon new release would be best.
The text was updated successfully, but these errors were encountered: