github-action-package
April 21, 2026 ยท View on GitHub
github-action-package
Read and modify the contents of package.json.
Example Usage
- name: package.json info
id: info
uses: jaywcjlove/github-action-package@main
- run: echo "name - ${{ steps.info.outputs.name }}"
- run: echo "version - ${{ steps.info.outputs.version }}"
- run: echo "description - ${{ steps.info.outputs.description }}"
- run: echo "author - ${{ steps.info.outputs.author }}"
- name: package.json info
id: info
uses: jaywcjlove/github-action-package@main
with:
data: |
{
"name": "@jaywcjlove/github-action-package-test"
}
- run: echo "name - ${{ steps.info.outputs.name }}"
- run: echo "version - ${{ steps.info.outputs.version }}"
- run: echo "description - ${{ steps.info.outputs.description }}"
- run: echo "author - ${{ steps.info.outputs.author }}"
- name: package.json info
id: info
uses: jaywcjlove/github-action-package@main
with:
rename: '@jaywcjlove/github-action-package-test'
- run: echo "name - ${{ steps.info.outputs.name }}"
- run: echo "version - ${{ steps.info.outputs.version }}"
- run: echo "description - ${{ steps.info.outputs.description }}"
- run: echo "author - ${{ steps.info.outputs.author }}"
delete nested values
{
"name": "github-action-package",
"author": "jaywcjlove",
"repository": {
"type": "git",
"url": "https://github.com/jaywcjlove/github-action-package"
},
"keywords": [
"actions",
"package"
]
}
- name: package.json info
uses: jaywcjlove/github-action-package@main
with:
unset: repository.type,repository.url,keywords
Output:
{
"name": "github-action-package",
"author": "jaywcjlove",
"repository": {}
}
Inputs
pathThe path of thepackage.jsonfile. Default:package.jsondatajson data for changingpackage.json. Default:{}renameUsed to change "name" data in "package.json".versionUsed to change "version" data in "package.json".descriptionUsed to change "description" data in "package.json".unsetdelete "Object" nested values in "package.json".
Output Parameters
nameThe name of the package.descriptionThis helps people discover your package, as it's listed in 'npm search'.versionVersion must be parseable by node-semver, which is bundled with npm as a dependency.homepageThe url to the project homepage.authorauthor field in package.jsonprivateprivate field in package.jsonlicenseYou should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.authorThis helps people discover your package as it's listed in 'npm search'.keywordsThis helps people discover your package as it's listed in 'npm search'.repositorySpecify the place where your code lives. This is helpful for people who want to contribute.osSpecify which operating systems your module will run on.cpucpu field in package.json
See Also
- Create Tags From Auto create tags from commit or package.json.
- Github Release Changelog Generator A GitHub Action that compares the commit differences between two branches
- Github Action Contributors Github action generates dynamic image URL for contributor list to display it!
- Generated Badges Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers)
- Create Coverage Badges Create coverage badges from coverage reports. (no 3rd parties servers)
- Action EJS A github action to render a
ejstemplate using github context
Contributors
As always, thanks to our amazing contributors!
Made with action-contributors.
License
Licensed under the MIT License.