Closed Locietta closed 2 years ago
Seems like just a re-run could fix this failure🤔
Partial rerun of release job in the workflow doesn't work though, maybe a thorough rerun can help? Anyway, it looks like an internal TypeScript Error in the release action...
Partial rerun of release job in the workflow doesn't work though, maybe a thorough rerun can help?
No luck...
So it's probably not my mistake in build.yml
, since reverting back to the last successful release doesn't change the situation. Still don't know what happens.
Going to see if changing the version of release action works.
Get a minimal reproduce:
when you don't have requested tag but enable the auto-generated release notes with broken release.yml
, we'll get the "can't read data of undefined" error.
when the tag already exists, the release action somehow will just upload assets without generating the error.
Still keep failing even with the correct release.yml
🤔
At least we can confirm auto-generating release notes is the trouble-maker.
Finally solve the problem🎉
For some notes:
Cannot read property 'data' of undefined
is caused by my broken release.yml
, and the reason why fix in PR didn't work is that the release action, by default, creates releases on main
branch, where the release.yml
is still broken.
Solution is easy: set target_commitish
to commit sha of current branch.
But be careful as ${{ github.sha }}
will return sha of the merge commit in a PR, not the latest commit we push. That's a bit tricky, so you may want something like:
- id: fetch_commit_sha
run: |
if [ ${{ github.event_name == 'pull_request' }} ]; then
echo "::set-output name=sha::${{ github.event.pull_request.head.sha }}"
else
echo "::set-output name=sha::${{ github.sha }}"
fi
- name: Release
uses: softprops/action-gh-release@v1
with:
target_commitish: ${{ steps.fetch_commit_sha.outputs.sha }}
......
release somehow failed with
The issue is already at softprops/action-gh-release#221. Seems like just a re-run could fix this failure🤔