rymndhng / release-on-push-action

Github Action to create a git tag + release when pushed to master
https://github.com/marketplace/actions/tag-release-on-push-action
MIT License
152 stars 47 forks source link

Can someone suggest what i'm missing ? - Error [ Message: For input string: ""] #93

Open Keshapally opened 11 months ago

Keshapally commented 11 months ago
Starting process...
Received context {:input/release-name Release <RELEASE_TAG>, :github/api-url https://api.github.com/, :github/output /github/file_commands/set_output_7dbf11af-bd06-4c78-87b2-ed0d35c1f59d, :bump-version-scheme minor, :input/tag-prefix ATOM_V, :input/max-commits 100, :token ***, :input/release-body , :input/use-github-release-notes false, :repo XXXXXXXX , :dry-run false, :sha d9eb89a531XXXXXXXXX9c2f7a454ad63[16](https://github.com/XXXXXXXXXXXX/actions/runs/6572617004/job/17854069715#step:3:17)c8e}
Fetching related data...
Generating release...
----- Error --------------------------------------------------------------------
Type:     java.lang.NumberFormatException
Message:  For input string: ""
Location: /var/src/release-on-push-action/src/release_on_push_action/core.clj:105:[29](https://github.com/XXXXXXXXXXX/actions/runs/6572617004/job/17854069715#step:3:30)

----- Context ------------------------------------------------------------------
101: 
102: (defn generate-new-release-data [context related-data]
103:   (let [bump-version-scheme (bump-version-scheme context related-data)
104:         current-version     (get-tagged-version (:latest-release related-data))
105:         next-version        (semver-bump current-version bump-version-scheme)
                                 ^--- For input string: ""
106:         base-commit         (get-in related-data [:latest-release-commit :sha])
107:         tag-name            (str (:input/tag-prefix context) next-version)
108: 
109:         ;; this is a lazy sequence
110:         commits-since-last-release (->> (github/list-commits-to-base context base-commit)
DasBen commented 11 months ago

Maybe a bit too late, but this action is pretty much dead. I just checked my PR for a fix and there is still nothing happening here.

Based on the error message "core.clj:105" I would say its this line: https://github.com/rymndhng/release-on-push-action/blob/master/src/release_on_push_action/core.clj#L105C9-L105C21

That means "next-version" as input is missing. Make sure this is set.

If you want more help, please also post your call of this action.

acnicholls commented 1 month ago

i had this exact error, my latest release was v1 with a tag exactly that. and I had 2 other tags v0.1.0-string and another like it, from earlier commits/releases that I had done manually

on a hunch because of next-version (**semver-bump** current-version bump-version-scheme), i went and added a semver compatible tag on the same commit that was my "latest' release.

it tag -a v1.0.0.0 <commit hash of "latest" release tag> -m "for semver"

and then I re-ran my workflow with the "re-run failed jobs" button and it was successful with the bump set to minor.
I got a release of v1.1.0 with all the trimmings. so delightful!

        with:
          bump_version_scheme: minor
          tag_prefix: v
          use_github_release_notes: true
          release_name: "Release <RELEASE_TAG>"
          release_body: "Bug fixes and features for stability of the application."

these are the with options I'm using, nothing really special...