Skip to content

Fix release asset upload for github-script v7#52

Merged
ktsaou merged 1 commit into
masterfrom
fix-publish-release-asset-upload
Jun 20, 2026
Merged

Fix release asset upload for github-script v7#52
ktsaou merged 1 commit into
masterfrom
fix-publish-release-asset-upload

Conversation

@ktsaou

@ktsaou ktsaou commented Jun 20, 2026

Copy link
Copy Markdown
Member

Problem

The publish workflow's asset-upload step fails on every tagged release. After the draft release is created, the Upload step errors with:

TypeError: Cannot read properties of undefined (reading 'uploadReleaseAsset')

Root cause

When the workflow actions were pinned to commit SHAs, actions/github-script was pinned to a v7 commit (3a2844b7…). In github-script v5+, the Octokit REST methods moved from github.* to github.rest.*. The inline upload script still calls github.repos.uploadReleaseAsset, which is undefined on v7 — so the step throws and no assets are attached.

The release is still created and tarballs are still built and uploaded as workflow artifacts; only the attach-to-release step fails.

Fix

Call github.rest.repos.uploadReleaseAsset instead. One line.

-                 await github.repos.uploadReleaseAsset({
+                 await github.rest.repos.uploadReleaseAsset({

The sibling Create Release step uses actions/create-release (not github-script) and is unaffected.

The publish workflow pins actions/github-script to a v7 commit, where
REST methods moved under github.rest.*. The asset upload still called
github.repos.uploadReleaseAsset, which is undefined on v7 and fails the
upload step after the release is created. Use github.rest.repos.
@codacy-production

codacy-production Bot commented Jun 20, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · +0.00% coverage variation

Metric Results
Coverage variation +0.00% coverage variation (-1.00%)
Diff coverage diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (4842a38) 3310 2235 67.52%
Head commit (a62b429) 3310 (+0) 2235 (+0) 67.52% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#52) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ktsaou ktsaou merged commit 5817369 into master Jun 20, 2026
17 checks passed
@ktsaou ktsaou deleted the fix-publish-release-asset-upload branch June 20, 2026 11:15
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

Successfully merging this pull request may close these issues.

1 participant