๐ญ Iโm currently working at JOIN Cycling as a Software Engineer all over our tech stack.
๐ฌ Ask me about new languages, innovative ideas and projects
This Action scans for a package.json file and reads the version number from that.
License: MIT License
This looks like what I need, but I'm not sure how to use it. Could you give an example workflow file?
Error: Container action is only supported on Linux
I have cause quite some issues around repositories by changing branch names and adding jq.
Both branches master and main now exist for a period before I completely switch to main.
Thanks for developing this useful action. I wonder whether you can upload a licence file so that I can use your action in my workflow.
I just configured this action and accidentally put the wrong path in there, which meant that the action could not find my package.json file, which makes sense.
However, that did not fail the package-version step, so I was debugging far later in the chain and wondering why the value was not used correctly. It was only after a while that I happened to open the output and wanted to look at the value it returned when I saw the "cat: can't open 'Resources/package.json': No such file or directory" message.
Unless I'm missing something, I think it would make sense to return a fail if the file can't be found. Even if for some reason this is not the default behavior, it might be useful to have an option failOnFileError
or something like that to achieve this behavior.
After release v.1.2.0 result value contains extra quotes ""
.
::set-output name=current-version::"0.2.4"
##[debug]steps['package-version']['outputs']['current-version']='"0.2.4"'
Hi,
The set-output command is now deprecated.
Warning: The
set-output
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
The Mac fails to be executed,how to resolve
It should be a good feature to select the package dir by adding add working-directory
key.
What do you think ?
thank you for the plugin !
After new release v1.2.0 I'm getting error in my actions:
Unable to resolve action `martinbeentjes/npm-get-version-action@master`, unable to find version `master`
Everything worked before this release.
Hi! Thanks for the action! I have a suggestion to add a broader tag to the action release cycle, which would allow having less strict minor and patch versions dependency declaration like this:
uses: martinbeentjes/npm-get-version-action@v1
Though the main catch is not to forget to move it further on every release :) Would it be possible?
It definitely exposes me as a noob but I was sort of lost on this for a minute and I knew it was me because the current docs are really straight forward.
Maybe it would be good for other noobs like me to add that we need to checkout repository step in our flows.
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
After the new release, the github action can't resolve the package:
Unable to resolve action `martinbeentjes/npm-get-version-action@master`, unable to find version `master`
I've started using npm-get-version-action in one of my workflows yesterday. Today, I noticed that some changes in the entrypoint.sh
were made and I'm not totally sure if my workflow is still not configured well or wether this change resulted in action no longer working properly. Anways, this is what I see in the logs of my workflow:
/entrypoint.sh: line 4: jq: not found
This is how I use the action (echo in the logs shows nothing):
- name: get-current-version
id: current-version
uses: martinbeentjes/npm-get-version-action@master
- name: logs
run: |
echo ${{ steps.current-version.outputs.current-version }}
This is causing the following annotation to show for any jobs using this action:
The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
When the package.json file has the word version in it in other fields, such as in the description, and the field occurs before the version field in the file, then the value of that field is used as the version. The workaround is to move the description or other offending fields below the version field in the file.
It would be helpful to use jq or something to more accurately parse the file and return the version without using grep.
Here's an example package.json that fails to detect the version properly https://github.com/getporter/vscode-extension/blob/15d7976fae18495f87fbad3b0f10113e11dfe5b2/package.json
Hello,
The documentation is still referencing the master
version, when the branch actually has been renamed to main
. This branch renaming broke the users' workflow, so personally, I recommend you reference a tagged version in the documentation instead of a branch name.
Thanks.
Reading package.json from /package.json
cat: can't open '/package.json': No such file or directory
I'm not sure if i'm doing something wrong but i keep getting
"cat: can't open './package.json': No such file or directory", although i have one in the root of the project. Could you point me in the right direction ?
Thanks!
Hello! thanks for this project!
I was wondering if there is a way to get only the major version from this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.