Comments (6)
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.
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.
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.
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.
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.
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)
- Simple set up question HOT 8
- [Question] How to do static checking with latest version with GitHub Packages HOT 2
- docs: update CONTRIBUTING.md
- [Feature] Compare branch package.json to main package.json HOT 2
- Pre-release changes still not working [Bug] HOT 19
- Is it possible to specify the package.json file to be used for checking version change?
- [Bug] `file-name` private repo not working HOT 4
- Should the documentation need to be updated on v2? HOT 3
- Token not being sent to GitHub's domain HOT 1
- Can the output be used as a boolean? HOT 1
- [Bug] The `set-output` command is deprecated and will be disabled soon HOT 1
- Error: Cannot read properties of undefined (reading '_links') HOT 7
- What permissions are need for this action HOT 2
- [Bug] Can't find version field HOT 2
- [Bug] 403 With ${{ secrets.GITHUB_TOKEN }} HOT 5
- [Feature] Add pre-release output HOT 4
- [Bug] v2.1.4 doesn't recognises version change but v2.1.3 does HOT 2
- Version Check Not Detecting Change Past 20 Commits HOT 4
- [Bug] version-check@master doesn't seem to work properly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from version-check.