Giter Club home page Giter Club logo

Comments (6)

EndBug avatar EndBug commented on August 28, 2024

Can you post a link to the actual action logs or, if the repo is private, a copy of the logs of the entire step that uses the action?

from version-check.

kleinpetr avatar kleinpetr commented on August 28, 2024

just this

Run EndBug/version-check@v2
  with:
    token: ***
    static-checking: localIsNew
    file-url: ::before
Searching for version update...
Error: Can't correctly read event file (before: undefined, repository: [object Object])

from version-check.

EndBug avatar EndBug commented on August 28, 2024

It seems like the action is able to parse the event file, but it doesn't contain a "before" tag...
Does this happen when you update the PR too?

from version-check.

kleinpetr avatar kleinpetr commented on August 28, 2024

No with second and more commits it works. But within the first I would like to compare it with the target branch.

Anyway I want just make a check that developers manually updated the version before merge it.

from version-check.

EndBug avatar EndBug commented on August 28, 2024

Oh, ok, I get it: in this case I think it would be better not to check against her previous commit, but against the base branch.
The current version of the action (a rewrite is needed, but I can't find the time to do it...) does not have a built-in way to do this, but you can use the github context to get the base ref and from that you can get you package file through the GitHub API.

github.base_ref should contain the ref of the base branch that is the target of the pull request. You can build the URL like this:

https://raw.githubusercontent.com/${{ github.repo }}/${{ github.base_ref }}/YOUR_PATH_TO_PACKAGE_FILE.JSON

So, recap:

- name: Check version number 👀
   id: version_check
   uses: EndBug/version-check@v2
   with:
   token: ${{ secrets.GITHUB_TOKEN }}
   static-checking: localIsNew
   # Replace YOUR_PATH_TO_PACKAGE_FILE.JSON with the local path of your package file.
   file-url: https://raw.githubusercontent.com/${{ github.repo }}/${{ github.base_ref }}/YOUR_PATH_TO_PACKAGE_FILE.JSON

- name: Check version number 👀
  if: steps.version_check.outputs.changed == 'false'
  run: |
    echo "No version change 🐞"
    exit 1

from version-check.

stale avatar stale commented on August 28, 2024

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

from version-check.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.