EndBug / version-check

:octocat: An action that allows you to check whether your npm package version has been updated
MIT License
102 stars 23 forks source link

[Bug] v2.1.4 doesn't recognises version change but v2.1.3 does #284

Closed radimkafka closed 5 months ago

radimkafka commented 5 months ago

Describe the bug When using latest version (2.1.4) actions' output is false (incorrectly) but when running on the same branch with version 2.1.3 output is correct

To Reproduce This steps output is wrong

- name: package.json version check
     id: package-check
     uses: EndBug/version-check@v2
     with:
       file-name: ./package.json

This steps output is good

- name: package.json version check
     id: package-check
     uses: EndBug/version-check@v2.1.3
     with:
       file-name: ./package.json

Expected behavior V2.1.4 should work same as 2.1.3

Additional context

GH actions output with v2 (2.1.4)

2024-04-24T16:42:21.3583904Z ##[group]Run EndBug/version-check@v2
2024-04-24T16:42:21.3584664Z with:
2024-04-24T16:42:21.3585140Z   file-name: ./package.json
2024-04-24T16:42:21.3586565Z   diff-search: false
2024-04-24T16:42:21.3588619Z   token: ***
2024-04-24T16:42:21.3589712Z   github-api-url: https://api.github.com
2024-04-24T16:42:21.3591162Z ##[endgroup]
2024-04-24T16:42:21.5200239Z Searching for version update...
2024-04-24T16:42:21.7735648Z ##[group]Searching in 12 commits...
2024-04-24T16:42:21.7737070Z Package file name: "package.json"
2024-04-24T16:42:21.7737754Z Package file URL: undefined
2024-04-24T16:42:21.7738513Z Version assumptions: undefined
2024-04-24T16:42:21.7739512Z ##[endgroup]
2024-04-24T16:42:21.7741143Z ##[endgroup]
2024-04-24T16:42:21.7741724Z No matching commit found.
2024-04-24T16:42:21.7743370Z ##[group]Outputs:
2024-04-24T16:42:21.7743958Z changed: false
2024-04-24T16:42:21.7744850Z ##[endgroup]

GH actions output with v2.1.3

2024-04-24T16:44:18.4146768Z ##[group]Run EndBug/version-check@v2.1.3
2024-04-24T16:44:18.4147264Z with:
2024-04-24T16:44:18.4147700Z   file-name: ./package.json
2024-04-24T16:44:18.4148063Z   diff-search: false
2024-04-24T16:44:18.4148577Z   token: ***
2024-04-24T16:44:18.4149054Z   github-api-url: https://api.github.com
2024-04-24T16:44:18.4149491Z ##[endgroup]
2024-04-24T16:44:18.5251123Z Searching for version update...
2024-04-24T16:44:18.7852403Z ##[group]Searching in 14 commits...
2024-04-24T16:44:18.7853199Z Package file name: "package.json"
2024-04-24T16:44:18.7853851Z Package file URL: undefined
2024-04-24T16:44:18.7854669Z Version assumptions: undefined
2024-04-24T16:44:18.7856874Z ##[endgroup]
2024-04-24T16:44:18.7857945Z No standard npm version commit found, switching to diff search (this could take more time...)
2024-04-24T16:44:18.7859146Z ##[group]Checking the diffs of 14 commits...
2024-04-24T16:44:18.9565910Z - 0afbb6a: no changes to the package file
2024-04-24T16:44:19.1147560Z - e18616d: no changes to the package file
2024-04-24T16:44:19.2824786Z - d2074e1: no changes to the package file
2024-04-24T16:44:19.3941160Z - 6c32155: no changes to the package file
2024-04-24T16:44:19.5168046Z - d43a1df: no changes to the package file
2024-04-24T16:44:19.6358161Z - 0394f06: no changes to the package file
2024-04-24T16:44:19.7446864Z - 8a0fa49: no changes to the package file
2024-04-24T16:44:19.9112417Z - 836473a: no changes to the package file
2024-04-24T16:44:20.0330356Z - 8a3673e: no changes to the package file
2024-04-24T16:44:20.1550052Z - 86bee5d: no changes to the package file
2024-04-24T16:44:20.2576191Z - dcb27bf: match found, more info below
2024-04-24T16:44:20.2578973Z ##[endgroup]
2024-04-24T16:44:20.2580040Z Found match for version 2.0.1: dcb27bf - v2.1.0
2024-04-24T16:44:20.2583219Z ##[group]Outputs:
2024-04-24T16:44:20.2583848Z changed: true
2024-04-24T16:44:20.2584674Z version: 2.0.1
2024-04-24T16:44:20.2585215Z type: undefined
2024-04-24T16:44:20.2589049Z commit: dcb27bf29c2a189d5108bf6b5bf803c243449b18
2024-04-24T16:44:20.2590557Z ##[endgroup]

Gh action run with 2.1.4 - https://github.com/radimkafka/toggl-jira-assistant-export/actions/runs/8820171261/job/24213141006 Gh action run with 2.1.3 - https://github.com/radimkafka/toggl-jira-assistant-export/actions/runs/8820192390/job/24213221132

EndBug commented 5 months ago

Hi, that was a bug that actually caused diff-search to always evaluate to true (see #281) So if you want to achieve the same behavior, please set diff-search to true

radimkafka commented 5 months ago

Oh, I see. Thanks for the info. :)