Homebrew / actions

🚀 Homebrew's GitHub Actions
BSD 2-Clause "Simplified" License
118 stars 39 forks source link

Error: inreplace failed when using `Homebrew/actions/bump-packages` #487

Closed Goooler closed 6 months ago

Goooler commented 7 months ago

I'm using Homebrew/actions/bump-packages in my brew repo to update packages automatically, but there is an error:

Bundled gems are installed into `../../../../../usr/local/Homebrew/Library/Homebrew/vendor/bundle`
==> Downloading https://github.com/Goooler/StringResExporter/releases/download/v0.2.2/string-res-exporter-0.2.2-binary.jar
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/741499626/357fc2a0-4c16-4ffd-8baf-22051a9c3318?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240215%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240215T050834Z&X-Amz-Expires=300&X-Amz-Signature=5ee805d9c9abfed6dfb9dd3e6ee08363fed3e6dcd4976b0253d22b301eac9ac5&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=741499626&response-content-disposition=attachment%3B%20filename%3Dstring-res-exporter-0.2.2-binary.jar&response-content-type=application%2Foctet-stream
Warning: Cannot verify integrity of '97f76233d2e50c5cd018758c945c277ad49dedff501f559f5b527037124eee71--string-res-exporter-0.2.2-binary.jar'.
No checksum was provided.
For your reference, the checksum is:
  sha256 "5855d97a86116d4c0bbc6d6c88bf05679d58b468f426b0ae7cabff40[84](https://github.com/Goooler/homebrew-repo/actions/runs/7911366480/job/21595451390#step:4:86)19535d"
==> replace /https:\/\/github\.com\/Goooler\/StringResExporter\/releases\/download\/v0\.2\.1\/string\-res\-exporter\-0\.2\.1\-binary\.jar/ with "https://github.com/Goooler/StringResExporter/releases/download/v0.2.2/string-res-exporter-0.2.2-binary.jar"
Error: inreplace failed
/usr/local/Homebrew/Library/Taps/goooler/homebrew-repo/Formula/string-res-exporter.rb:
  expected replacement of /https:\/\/github\.com\/Goooler\/StringResExporter\/releases\/download\/v0\.2\.1\/string\-res\-exporter\-0\.2\.1\-binary\.jar/ with "https://github.com/Goooler/StringResExporter/releases/download/v0.2.2/string-res-exporter-0.2.2-binary.jar"
==> replace "3ef13f0d454f73b037c4bfa52bc6814fb92ab815cdaf66d2d8920c6e9728737c" with "5[85](https://github.com/Goooler/homebrew-repo/actions/runs/7911366480/job/21595451390#step:4:87)5d97a[86](https://github.com/Goooler/homebrew-repo/actions/runs/7911366480/job/21595451390#step:4:88)116d4c0bbc6d6c[88](https://github.com/Goooler/homebrew-repo/actions/runs/7911366480/job/21595451390#step:4:90)bf05679d58b468f426b0ae7cabff408419535d"

how can I fix it, is there any syntax error in my formula? See

Bo98 commented 7 months ago

brew bump doesn't currently support string interpolation (the #{version} you have in your formula's url line).

Goooler commented 7 months ago

Reverting the version placeholder in https://github.com/Goooler/homebrew-repo/commit/f144b4caf5d078ff1992068c3a286f3dec00a1b7, with a new error:

==> Downloading https://github.com/Goooler/StringResExporter/releases/download/v0.2.2/string-res-exporter-0.2.2-binary.jar
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/741499626/357fc2a0-4c16-4ffd-8baf-22051a9c3318?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240215%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240215T055551Z&X-Amz-Expires=300&X-Amz-Signature=7408944d4609c9790e00d15c5a75f2c4fcf8f7acc54e8d95aff5ea331b848f82&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=741499626&response-content-disposition=attachment%3B%20filename%3Dstring-res-exporter-0.2.2-binary.jar&response-content-type=application%2Foctet-stream
Warning: Cannot verify integrity of '97f76233d2e50c5cd018758c945c277ad49dedff501f559f5b527037124eee71--string-res-exporter-0.2.2-binary.jar'.
No checksum was provided.
For your reference, the checksum is:
  sha256 "5[85](https://github.com/Goooler/homebrew-repo/actions/runs/7911711266/job/21596297592#step:4:87)5d97a86116d4c0bbc6d6c88bf05679d58b468f426b0ae7cabff408419535d"
==> replace /https:\/\/github\.com\/Goooler\/StringResExporter\/releases\/download\/v0\.2\.1\/string\-res\-exporter\-0\.2\.1\-binary\.jar/ with "https://github.com/Goooler/StringResExporter/releases/download/v0.2.2/string-res-exporter-0.2.2-binary.jar"
==> replace "3ef13f0d454f73b037c4bfa52bc6814fb92ab815cdaf66d2d8920c6e9728737c" with "5855d97a[86](https://github.com/Goooler/homebrew-repo/actions/runs/7911711266/job/21596297592#step:4:88)116d4c0bbc6d6c[88](https://github.com/Goooler/homebrew-repo/actions/runs/7911711266/job/21596297592#step:4:90)bf05679d58b468f426b0ae7cabff408419535d"
Error: You need to bump this formula manually since the new version
and old version are both 0.2.1.
SMillerDev commented 7 months ago

That one is pretty clear though, it is already at the version it's trying to bump to.

Goooler commented 7 months ago

I noticed

Current formula version:  0.2.1
Latest livecheck version: 0.2.2
Latest Repology version:  not found

My latest tag of this formula should be 0.2.2 instead of 0.2.1, the new version and old version are not both 0.2.1.

ZhongRuoyu commented 7 months ago

The version can be auto-detected from the URL, so version "0.2.1" is not necessary. Does it work if you remove that?

Goooler commented 7 months ago

After removing version property, it works well. Thanks!

There are 2 things left:

MikeMcQuaid commented 7 months ago

Yes or, better still, add a better error message that makes it fail.

  • Can we leave this issue for support using string interpolation with bump action?

No, I'd rather we didn't leave an issue open for this as it's somewhat undesirable. If you'd like to implement it: we'll review a PR but doesn't need an issue open.

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.