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

Version Check Not Detecting Change Past 20 Commits #287

Open ayeung-godaddy opened 5 months ago

ayeung-godaddy commented 5 months ago

Based on reading the source code, I understand that once there are more than 20+ commits, the GHA is limited and may not check all commits for a package.json version change.

However, in the code, if a commit message contains the release version and it matches the packageObj.version then it should find and detect the change (here).

For context, these are the settings of the action when I run it:

Actions.versionCheck({
        name: 'Check for Version Change',
        id: 'check-version-change',
        with: {
          'diff-search': 'true',
          'file-name': `projects/${projectName}/package.json`,
          'token': '${{ secrets.GITHUB_TOKEN }}'
        }
      }),

So, since there are 20+ commits, it is not checking every commit for a package.json version update which is expected. But even when I do a later commit with a semver version in the message, it doesn't detect it. Is that expected too??

Proposed solution: Can commits somehow be reversed so that the most recent 20 commits are checked instead of the first 20? Or can there be a flag to allow this to happen? I'm not entirely sure where this change would go (here maybe?).

EndBug commented 5 months ago

Heyy, that's actually a nice point. I don't remember the reason why it wasn't so trivial to do that, maybe the commits are paginated or something. But I see in the source code that at the time i put a warning mentioning a limit with GitHub's webhooks, so idk

I'll keep this pinned though!

ayeung-godaddy commented 5 months ago

@EndBug Awesome thank you! Just wondering, how do you test your changes on this GHA? If I were to propose some changes and create a PR, do I need to use my local changes in another PR to test that my changes are working as expected?

ayeung-godaddy commented 5 months ago

https://github.com/EndBug/version-check/pull/288

EndBug commented 5 months ago

How do you test your changes on this GHA? If I were to propose some changes and create a PR, do I need to use my local changes in another PR to test that my changes are working as expected?

Heyy @ayeung-godaddy, TLDR: afaik, yes 😅

I now have my own repo set up to test my actions, and I usually run them on that one. I know that there are some tools that are able to run GitHub Actions locally, mocking event payloads, but they didn't exist when I first started developing actions, and I've never really took the time to look into them.

It would be nice to have a proper CI, but for the time being I have to manually test the changes :/