diff --git a/publish/action.yml b/publish/action.yml index 134eaea..f92343c 100644 --- a/publish/action.yml +++ b/publish/action.yml @@ -104,12 +104,6 @@ runs: exit 1 fi - # Resolve the exact commit SHA the tag points to. Using git rev-list - # rather than github.sha avoids the common mismatch where the workflow - # was triggered from a pre-release commit but the tag was created on - # the subsequent release commit by the prepare job. - tag_sha="$(git rev-list -n 1 "${TAG_NAME}")" - release_notes="$(cat "$RELEASE_NOTES_FILE")" escaped_release_notes="$(printf '%s' "$release_notes" | sed 's/\\/\\\\/g; s/"/\\"/g; :a;N;$!ba;s/\n/\\n/g')" release_api="${GITHUB_API_URL:-${GITHUB_SERVER_URL%/}/api/v1}/repos/${GITHUB_REPOSITORY}/releases" @@ -133,7 +127,7 @@ runs: -H "Authorization: token ${TOKEN}" \ -H "Content-Type: application/json" \ "${release_api}/${existing_release_id}" \ - --data "{\"tag_name\":\"${TAG_NAME}\",\"target\":\"${tag_sha}\",\"name\":\"${TAG_NAME}\",\"body\":\"${escaped_release_notes}\",\"draft\":false,\"prerelease\":false}" \ + --data "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"${TAG_NAME}\",\"body\":\"${escaped_release_notes}\",\"draft\":false,\"prerelease\":false}" \ --output release.json echo "id=$existing_release_id" >> "$GITHUB_OUTPUT" @@ -147,7 +141,7 @@ runs: -H "Authorization: token ${TOKEN}" \ -H "Content-Type: application/json" \ "${release_api}" \ - --data "{\"tag_name\":\"${TAG_NAME}\",\"target\":\"${tag_sha}\",\"name\":\"${TAG_NAME}\",\"body\":\"${escaped_release_notes}\",\"draft\":false,\"prerelease\":false}" \ + --data "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"${TAG_NAME}\",\"body\":\"${escaped_release_notes}\",\"draft\":false,\"prerelease\":false}" \ --output release.json release_id="$(sed -n 's/.*"id"[[:space:]]*:[[:space:]]*\([0-9][0-9]*\).*/\1/p' release.json | head -n 1)"